diff --git a/lib/builder.js b/lib/builder.js index 3420356..9256dd0 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -86,9 +86,13 @@ exports.getDllWebpackConfig = (config, option = {}) => { const dll = WebpackDllBuilder.getDllConfig(config.dll); const cli = utils.isObject(config.cli) ? config.cli : {}; const webpackConfigList = []; + const plugins = []; + if (cli.size) { + plugins.push(cli.size === true ? { analyzer: true } : { stats: true }); + } dll.forEach(item => { const tmpConfig = utils.cloneDeep(config); - const dllConfig = merge(tmpConfig, { entry: null, dll: null }, { dll: item }, item.webpackConfig); + const dllConfig = merge(tmpConfig, { entry: null, dll: null, plugins }, { dll: item }, item.webpackConfig); if (option.onlyView || cli.dll || utils.checkDllUpdate(config, item)) { webpackConfigList.push(new WebpackDllBuilder(dllConfig).create()); }