From 4e0274d3880d3ed9120cbea6021b95323907cb5e Mon Sep 17 00:00:00 2001 From: dengyc Date: Thu, 2 Jan 2020 20:23:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20windows=E4=B8=8B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=20weapp.compile.exclude=20=E4=B8=BA=20npm=20=E5=8C=85=E6=97=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98=20(#5227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/util/resolve_npm_files.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-cli/src/util/resolve_npm_files.ts b/packages/taro-cli/src/util/resolve_npm_files.ts index dd99b33ee1a0..2ea8bae3cbce 100644 --- a/packages/taro-cli/src/util/resolve_npm_files.ts +++ b/packages/taro-cli/src/util/resolve_npm_files.ts @@ -422,7 +422,7 @@ async function recursiveRequire ({ const npmExclude = (compileConfig.exclude || []).filter(item => /(?:\/|^)node_modules(\/|$)/.test(item)) let isNpmInCompileExclude = false for (const item of npmExclude) { - isNpmInCompileExclude = filePath.indexOf(item) !== -1 + isNpmInCompileExclude = filePath.replace(/\\/g, '/').indexOf(item) !== -1 if (isNpmInCompileExclude) { break }