From 4745b4440e6a06d5c722cff44a0f6ddec7a315e0 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 26 Dec 2018 16:33:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20node=5Fmodules=20=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8B=B7=E8=B4=9D=E4=B8=8D=E5=85=A8=EF=BC=8C?= =?UTF-8?q?close=20#1697?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/weapp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-cli/src/weapp.js b/packages/taro-cli/src/weapp.js index 6a9a3f2a172f..2cfc4f4f8452 100644 --- a/packages/taro-cli/src/weapp.js +++ b/packages/taro-cli/src/weapp.js @@ -180,7 +180,7 @@ function analyzeImportUrl ({ astPath, value, depComponents, sourceFilePath, file if (Util.REG_SCRIPT.test(valueExtname) || Util.REG_TYPESCRIPT.test(valueExtname)) { const vpath = path.resolve(sourceFilePath, '..', value) let fPath = value - if (fs.existsSync(vpath) && !NODE_MODULES_REG.test(vpath)) { + if (fs.existsSync(vpath) && vpath !== sourceFilePath) { fPath = vpath } if (scriptFiles.indexOf(fPath) < 0) { @@ -688,7 +688,7 @@ function parseAst (type, ast, depComponents, sourceFilePath, filePath, npmSkip = } else if (Util.REG_SCRIPT.test(valueExtname) || Util.REG_TYPESCRIPT.test(valueExtname)) { const vpath = path.resolve(sourceFilePath, '..', value) let fPath = value - if (fs.existsSync(vpath) && !NODE_MODULES_REG.test(vpath)) { + if (fs.existsSync(vpath) && vpath !== sourceFilePath) { fPath = vpath } if (scriptFiles.indexOf(fPath) < 0) {