vue-storefront-1
vue-storefront-1 copied to clipboard
[ Nicer to have ] Optimize webpack build time
- removing unnecessary loaders
- minimize the scope of loaders
https://webpack.js.org/guides/build-performance/
It's also worth to add PNP. I'm working on it but unfortunately, it requires a lot of effort :)
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.
Maybe the devtool source-map should be replaced with something else from this list with faster build time:
https://webpack.js.org/configuration/devtool/