Answer the question
In order to leave comments, you need to log in
Why long webpack build?
Hey!
Help me figure out why Webpack build takes a long time
. Approximately 7 - 15 seconds are needed to build and reload.
Here is the project
Answer the question
In order to leave comments, you need to log in
The problem is imagemin-webpack-plugin .
The fact is that the minification of images occurs not only with each launch of the assembly, but also with each recompilation.
To avoid re-minification - you can cache minified images. The plugin has an option cacheFolder , which specifies the path to the folder where the cache files will be stored.
Documentation.
Sample code:
new ImageminWebpackPlugin({
cacheFolder: path.resolve(__dirname, 'src/cache'),
test: /\.(jpe?g|png|gif|svg)$/,
disable: isProd,
pngquant: {
quality: '75',
},
}),
ImageminWebpWebpackPlugin can take a long time to process images. Try disabling it and check.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question