Skip to content

Commit

Permalink
fix(mini-runner): npm 中文件不会经过 taro 包替换操作
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 31, 2019
1 parent 6abb72b commit 975efa2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/taro-mini-runner/src/loaders/fileParseLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ function processAst (
const source = node.source
let value = source.value
const specifiers = node.specifiers
if (type === PARSE_AST_TYPE.NORMAL) {
return
}
if (isNpmPkg(value) && !isQuickAppPkg(value)) {
if (value === taroJsComponents) {
if (isQuickApp) {
Expand All @@ -180,8 +183,8 @@ function processAst (
taroSelfComponents.add(_.kebabCase(name))
}
})
taroSelfComponents.add('taro-page')
}
taroSelfComponents.add('taro-page')
astPath.remove()
} else {
const specifiers = node.specifiers
Expand Down Expand Up @@ -222,6 +225,9 @@ function processAst (
const args = node.arguments as t.StringLiteral[]
let value = args[0].value
const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration
if (type === PARSE_AST_TYPE.NORMAL) {
return
}
if (isNpmPkg(value) && !isQuickAppPkg(value)) {
if (value === taroJsComponents) {
if (isQuickApp) {
Expand Down

0 comments on commit 975efa2

Please sign in to comment.