enable ModuleConcatenationPlugin for client bundles

This commit is contained in:
Pooya Parsa 2017-08-17 22:54:20 +04:30
parent 8266f717b9
commit e0782af53e
2 changed files with 8 additions and 8 deletions

View File

@ -142,11 +142,6 @@ export default function webpackBaseConfig ({ isClient, isServer }) {
minimize: true minimize: true
}) })
) )
// Scope Hoisting
// config.plugins.push(
// new webpack.optimize.ModuleConcatenationPlugin()
// )
} }
// Clone deep avoid leaking config between Client and Server // Clone deep avoid leaking config between Client and Server

View File

@ -135,6 +135,14 @@ export default function webpackClientConfig () {
// Production specific config // Production specific config
// -------------------------------------- // --------------------------------------
if (!this.options.dev) { if (!this.options.dev) {
// Scope Hoisting
config.plugins.push(
new webpack.optimize.ModuleConcatenationPlugin()
)
// https://webpack.js.org/plugins/hashed-module-ids-plugin
config.plugins.push(new webpack.HashedModuleIdsPlugin())
// Minify JS // Minify JS
config.plugins.push( config.plugins.push(
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
@ -145,9 +153,6 @@ export default function webpackClientConfig () {
}) })
) )
// https://webpack.js.org/plugins/hashed-module-ids-plugin
config.plugins.push(new webpack.HashedModuleIdsPlugin())
// Webpack Bundle Analyzer // Webpack Bundle Analyzer
if (this.options.build.analyze) { if (this.options.build.analyze) {
config.plugins.push( config.plugins.push(