mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 04:42:40 +02:00
feat(v2): faster production server build (#1306)
* feat(v2): faster production server build * nits
This commit is contained in:
parent
290ccc5315
commit
c6c22a8271
2 changed files with 6 additions and 0 deletions
|
@ -83,7 +83,10 @@ module.exports = function createBaseConfig(props, isServer) {
|
|||
.use('babel')
|
||||
.loader('babel-loader')
|
||||
.options({
|
||||
// ignore local project babel config (.babelrc)
|
||||
babelrc: false,
|
||||
// ignore local project babel config (babel.config.js)
|
||||
configFile: false,
|
||||
presets: ['@babel/env', '@babel/react'],
|
||||
plugins: [
|
||||
isServer ? 'dynamic-import-node' : '@babel/syntax-dynamic-import',
|
||||
|
|
|
@ -18,6 +18,9 @@ module.exports = function createServerConfig(props) {
|
|||
config.target('node');
|
||||
config.output.filename('server.bundle.js').libraryTarget('commonjs2');
|
||||
|
||||
// no need to minimize server bundle since we only run server compilation to generate static html files
|
||||
config.optimization.minimize(false);
|
||||
|
||||
// Workaround for Webpack 4 Bug (https://github.com/webpack/webpack/issues/6522)
|
||||
config.output.globalObject('this');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue