Skip to content

Commit

Permalink
fix: webpack-tool proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
hubcarl committed Nov 14, 2018
1 parent b5bc5d3 commit fa11a07
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ exports.getDllWebpackConfig = (config = {}, option = {}) => {
return exports.WebpackBuilder.getDllWebpackConfig(config);
};

exports.build = (webpackConfig, option, callback) => {
return new WebpackTool().build(webpackConfig, option, callback);
exports.build = (webpackConfig, config, callback) => {
return new WebpackTool(config).build(webpackConfig, config, callback);
};

exports.server = (webpackConfig, option, callback) => {
return new WebpackTool().server(webpackConfig, option, callback);
exports.server = (webpackConfig, config, callback) => {
return new WebpackTool(config).server(webpackConfig, config, callback);
};
20 changes: 19 additions & 1 deletion lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ exports.getDllWebpackConfig = (config, option = {}) => {
const host = config.host;
const configLoaders = config.loaders || {};
const configPlugins = config.plugins || {};
const optimization = config.optimization;
const loaders = {};
const plugins = {};
const cli = utils.isObject(config.cli) ? config.cli : {};
Expand All @@ -115,7 +116,24 @@ exports.getDllWebpackConfig = (config, option = {}) => {
}
}
dllArray.forEach(item => {
const builderConfig = Object.assign({}, dllConfig, { host, node, compile, prefix, entry: {}, dll: item, publicPath, buildPath, alias, externals, resolveLoader, install, cdn, loaders, plugins }, item.webpackConfig);
const builderConfig = Object.assign({}, dllConfig, {
host,
node,
compile,
prefix,
entry: {},
dll: item,
publicPath,
buildPath,
alias,
externals,
resolveLoader,
install,
cdn,
loaders,
plugins,
optimization
}, item.webpackConfig);
if (option.onlyView || cli.dll || utils.checkDllUpdate(config, item)) {
dllWebpackConfig.push(new WebpackDllBuilder(builderConfig).create());
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easywebpack",
"version": "4.10.0-rc.2",
"version": "4.10.0-rc.3",
"description": "基于 Webpack 的前端构建工程化解决方案",
"keywords": [
"webpack",
Expand Down Expand Up @@ -59,7 +59,7 @@
"webpack-hot-middleware": "^2.13.2",
"webpack-manifest-resource-plugin": "^4.0.0",
"webpack-node-externals": "^1.6.0",
"webpack-tool": "^4.2.0"
"webpack-tool": "next"
},
"devDependencies": {
"chai": "^4.0.0",
Expand Down

0 comments on commit fa11a07

Please sign in to comment.