mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 05:27:00 +02:00
feat: allow user to modify generated webpack config
This commit is contained in:
parent
2b5ee3e869
commit
10b1a38762
9 changed files with 172 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue