From bc152e38705185aa39a84a85dd787ad9e4c18cde Mon Sep 17 00:00:00 2001 From: markthree <1801982702@qq.com> Date: Tue, 16 Aug 2022 22:49:52 +0800 Subject: [PATCH] fix: slash some path for windows (#48) Co-authored-by: Eduardo San Martin Morote --- src/core/RoutesFolderWatcher.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/RoutesFolderWatcher.ts b/src/core/RoutesFolderWatcher.ts index 51ac3c81..2f629eb7 100644 --- a/src/core/RoutesFolderWatcher.ts +++ b/src/core/RoutesFolderWatcher.ts @@ -1,4 +1,5 @@ import chokidar from 'chokidar' +import { normalize } from 'pathe' import { ResolvedOptions, RoutesFolderOption } from '../options' export class RoutesFolderWatcher { @@ -32,6 +33,8 @@ export class RoutesFolderWatcher { handler: (context: HandlerContext) => void ) { this.watcher.on(event, (filePath) => { + // ensure consistent path for Windows and Unix + filePath = normalize(filePath) // skip other extensions if ( this.options.extensions.every(