[Vuejs]-Migrating from webpack 2.7 to 4.1.1, noticed bad performance results

0👍

Are you looking at development or production mode bundle sizes? In my experiences so far, the development mode build is larger in size, they aren’t optimizing for size in dev, they are optimizing for compile/re-compile speed so I think they made a tradeoff here in v4 (my dev bundle builds about 1.7x faster).

If your production builds (with uglifyjs below) are bigger, then that is concerning.

Try adding uglifyjs to your production mode build:

yarn add uglifyjs-webpack-plugin --dev

const UglifyJsWebpackPlugin = require('uglifyjs-webpack-plugin');

config = {
  ...,
  optimization: {
    minimization: [
      new UglifyJsWebpackPlugin({
        parallel: true,
        sourceMap: <true/false>,
      })
    ],
  },
}

Leave a comment