feat(v2): faster production server build (#1306)

* feat(v2): faster production server build

* nits
This commit is contained in:
Endilie Yacop Sucipto 2019-03-25 15:21:37 +07:00 committed by GitHub
parent 290ccc5315
commit c6c22a8271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -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',

View file

@ -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');