Skip to content

Commit

Permalink
fix(mini-runner): 修复使用 preval 报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 31, 2019
1 parent 86a7372 commit 24701e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions packages/taro-mini-runner/src/loaders/fileParseLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ export default function fileParseLoader (source, ast) {
const filePath = this.resourcePath
const newAst = transformFromAst(ast, '', {
plugins: [
[require('babel-plugin-preval')],
[require('babel-plugin-danger-remove-unused-import'), { ignore: cannotRemoves }],
[require('babel-plugin-transform-define').default, constantsReplaceList]
]
Expand Down
1 change: 0 additions & 1 deletion packages/taro-mini-runner/src/webpack/build.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export default (appPath: string, mode, config: Partial<IBuildConfig>): any => {
isBuildPlugin: config.isBuildPlugin
})
plugin.definePlugin = getDefinePlugin([constantsReplaceList])
console.log(commonChunks)
const customCommonChunks = commonChunks && commonChunks.length ? commonChunks : !!config.isBuildPlugin ? ['plugin/runtime', 'plugin/vendors'] : ['runtime', 'vendors']
plugin.miniPlugin = getMiniPlugin({
sourceDir,
Expand Down

0 comments on commit 24701e6

Please sign in to comment.