I'm trying to determine what is taking my webpack build so long. I'm struggling to find any logging options or debug options so webpack will log information about what its doing... I've looked around and seen a couple things like the noInfo: false option but that doesnt do anything for me...
I'm uing the node.js api. Here's an example:
var compiler = webpack(config)
compiler.run(function(err, stats) {
if (err) {
console.error(err)
return
} else {
fs.writeFileSync(path.join(root, 'webpack', 'stats.'+projectName+'.json'), stats.toJson(), 'utf8')
console.log("done: stats."+projectName+'.json')
}
});
Over the past eight years, webpack has become increasingly powerful. However, due to the additional packaging process, the building speed is getting slower as the project grows. As a result, each startup takes dozens of seconds (or minutes), followed by a round of build optimization.
Click the "inspect" link under each script to open a dedicated debugger or the Open dedicated DevTools for Node link for a session that will connect automatically. You can also check out the NiM extension, a handy Chrome plugin that will automatically open a DevTools tab every time you --inspect a script.
Webpack v4+ will minify your code by default in production mode .
Although an old question, it's useful to know that new plugins have been released to help track down performance bottlenecks.
For example, you could try using something like the Speed Measure Webpack Plugin to see how long different loaders and plugins are taking to run in your configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With