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

@ -2,6 +2,7 @@ const path = require('path');
const staticSiteGenerator = require('static-site-generator-webpack-plugin');
const webpackNiceLog = require('webpack-nicelog');
const createBaseConfig = require('./base');
const {applyChainWebpack} = require('./utils');
module.exports = function createServerConfig(props) {
const config = createBaseConfig(props, true);
@ -32,5 +33,8 @@ module.exports = function createServerConfig(props) {
.plugin('niceLog')
.use(webpackNiceLog, [{name: 'Server', color: 'yellow'}]);
// user extended webpack-chain config
applyChainWebpack(props.siteConfig.chainWebpack, config, true);
return config;
};