vue-storefront-1 icon indicating copy to clipboard operation
vue-storefront-1 copied to clipboard

[ Nicer to have ] Optimize webpack build time

Open filrak opened this issue 6 years ago • 3 comments

  • removing unnecessary loaders
  • minimize the scope of loaders

https://webpack.js.org/guides/build-performance/

filrak avatar Jun 25 '19 10:06 filrak

It's also worth to add PNP. I'm working on it but unfortunately, it requires a lot of effort :)

lukeromanowicz avatar Oct 10 '19 08:10 lukeromanowicz

I dived into this a bit: The babel-loader could be improved a bit by adding a cacheDirectory flag to it in the core/webpack.base.config.ts file:

loader: 'babel-loader?cacheDirectory',

Disabling the following line speeds up a bit as well (and obviously disables source mapping, but maybe this is not needed by everyone). In the same file:

devtool: 'source-map',

Parallel processing might do a lot, but this requires heavy refactoring of the current Webpack configuration.

The HardSourceWebpackPlugin plugin doesn't show improvement in my case.

jissereitsma avatar Oct 18 '19 14:10 jissereitsma

Maybe the devtool source-map should be replaced with something else from this list with faster build time: https://webpack.js.org/configuration/devtool/

pschaub avatar Oct 05 '20 11:10 pschaub