feat: allow user to modify generated webpack config

This commit is contained in:
endiliey 2018-08-30 03:30:44 +08:00
parent 2b5ee3e869
commit 10b1a38762
9 changed files with 172 additions and 3 deletions

View file

@ -13,6 +13,7 @@ const serve = require('webpack-serve');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const load = require('../load');
const createClientConfig = require('../webpack/client');
const {applyConfigureWebpack} = require('../webpack/utils');
function getHost(reqHost) {
return reqHost || 'localhost';
@ -72,6 +73,13 @@ module.exports = async function start(siteDir, cliOptions = {}) {
}
]);
config = config.toConfig();
// apply user webpack config
const {
siteConfig: {configureWebpack}
} = props;
config = applyConfigureWebpack(configureWebpack, config, false);
const compiler = webpack(config);
// webpack-serve