Webpack --w (watch) operation takes 3-5 minutes to build changes

As the number of files are growing webpack watch command build time is also increasing.
How can we speed up the watch process?

That clearly sounds weird. Have you checked a fresh new project and whether it takes so long there as well? If not it could indicate some issues with your project setup

I have another project with less files(typescript and html) running same webpack configurations and build time is less than 30 seconds after any change

Even that sounds like quite a lot to me. Should be merely a couple of secs. I’m not used to webpack but a cli bundler based projects recompiles and refreshes in max 3-4secs.

So you have another PC where you can try it out? Could it be you’re running on an old spinning drive vs SSD?

It could also depend on which version of TypeScript you use, I know there were a few improvements with TypeScript in some libs that were having extremely slow build time like this TS issue - Add watchOptions to tsconfig and allow supplying them on command line as well. So perhaps make sure you use TypeScript version higher than 3.8

There’s also this article that might be related and I have seen in a few issues/articles were many users say high CPU time (like a 100% CPU)