diff --git a/packages/taro-runner-utils/src/resolve/MultiPlatformPlugin.ts b/packages/taro-runner-utils/src/resolve/MultiPlatformPlugin.ts index bfe2053c2b1c..edfb5ed207c3 100644 --- a/packages/taro-runner-utils/src/resolve/MultiPlatformPlugin.ts +++ b/packages/taro-runner-utils/src/resolve/MultiPlatformPlugin.ts @@ -79,7 +79,7 @@ export class MultiPlatformPlugin { private includes (filePath: string): boolean { if (!this.options.include || !this.options.include.length) return false - filePath = filePath.replace(path.sep, '/') + filePath = filePath.replace(/[\\/]/g, '/'); const res = this.options.include.find(item => filePath.includes(item)) return Boolean(res)