webpack-contrib/cache-loader

Question: cacheDirectory in babel-loader + cache-loader... does it makes sense (=> Doc)

swernerx opened this issue · 4 comments

It would be great help if someone could figure out whether it's reasonable to combine the cache-loader with the cache feature of Babel. Whether to combine both or prefer one of them etc. I think that's also a pretty fundamental question the readme should answer - Thanks!

@swernerx it is just example, your can use cache-loader with your css-loader (style-loader -> cache-loader -> css-loader -> postcss-loader -> etc)

Just test it by adding and removing cache-loader, I'm not seeing any real difference in performance so my guess is that the babel cache performs as well as using cache-loader.

They both serve the same purpose and are interchangeable, with cache-loader being the 'newer and official' way to cache a loader in general

In my experience, with cache-loader rebuild time increased dramatically – from 2.5s to 9.5s. While initial build time decreased for ~40s.
Caching from babel-loader speeds up initial build a bit less, but does not affect rebuild time.
So I use cache-loader for caching styles only, and babel-loader caching for js.