Skip to content

Commit

Permalink
🐛 Fix unoptimized webpack module output
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Sep 11, 2023
1 parent 2538790 commit 0a518bc
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,24 @@ module.exports = {
path: BUILD_DIR,
publicPath: `/${BUILD_DIR_NAME}/`,
},
optimization: {
minimize: !DEBUG,
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all',
},
common: {
chunks: 'all',
name: 'common',
minChunks: 2,
},
},
},
runtimeChunk: false,
},
performance: {
maxEntrypointSize: 1000000,
maxAssetSize: 300000,
Expand Down Expand Up @@ -157,8 +175,6 @@ module.exports = {
new webpack.HotModuleReplacementPlugin(),
] : [
// Production
new webpack.HashedModuleIdsPlugin(),
new webpack.DefinePlugin({ 'global.GENTLY': false }),
new webpack.optimize.ModuleConcatenationPlugin(),
]),
};

0 comments on commit 0a518bc

Please sign in to comment.