Skip to content

Commit

Permalink
fix(cli): node_modules 中的文件拷贝不全,close #1697
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 26, 2018
1 parent 53c9337 commit 4745b44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/taro-cli/src/weapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4745b44

Please sign in to comment.