Skip to content

Commit

Permalink
fix(mini-runner): 只有 taro 的包不能经过依赖包名替换
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 16, 2019
1 parent e686427 commit 2c39d37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/taro-mini-runner/src/loaders/fileParseLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
taroJsComponents,
taroJsRedux,
QUICKAPP_SPECIAL_COMPONENTS,
PARSE_AST_TYPE
PARSE_AST_TYPE,
NODE_MODULES_REG
} from '../utils/constants'
import {
isNpmPkg,
Expand Down Expand Up @@ -171,7 +172,7 @@ function processAst (
const source = node.source
let value = source.value
const specifiers = node.specifiers
if (type === PARSE_AST_TYPE.NORMAL) {
if (NODE_MODULES_REG.test(sourceFilePath) && sourceFilePath.indexOf(taroMiniAppFramework) >= 0) {
return
}
if (isNpmPkg(value) && !isQuickAppPkg(value)) {
Expand Down Expand Up @@ -225,7 +226,7 @@ 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) {
if (NODE_MODULES_REG.test(sourceFilePath) && sourceFilePath.indexOf(taroMiniAppFramework) >= 0) {
return
}
if (isNpmPkg(value) && !isQuickAppPkg(value)) {
Expand Down

0 comments on commit 2c39d37

Please sign in to comment.