Skip to content

Commit

Permalink
fix: 修复webpack没有添加target问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hxfdarling committed Aug 14, 2019
1 parent 52d8033 commit 38012bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/a8k/src/plugins/config-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class BaseConfig {
// 其他模式可以选择开启
devtool = 'source-map';
}

configChain.target('web');
// css/optimization 配置中需要使用bool
options.sourceMap = Boolean(devtool);

Expand All @@ -49,6 +49,10 @@ export default class BaseConfig {
}
}

if (type === BUILD_TARGET.NODE) {
configChain.target('node');
}

// 这些库都是不依赖其它库的库 不需要解析他们可以加快编译速度
// config.module.noParse(/node_modules\/(moment)/);
// 动态依赖默认不处理子目录,仅处理单层目录
Expand Down

0 comments on commit 38012bc

Please sign in to comment.