Giter VIP home page Giter VIP logo

Comments (6)

sentience avatar sentience commented on May 30, 2024 25

I'd recommend against using both cache-loader and hard-source-webpack-plugin together, since each one incurs a cost on the first (uncached) build to create its cache, and you'll be duplicating a lot of work maintaining two caches of the same thing.

Setting up hard-source-webpack-plugin is really easy for most configs; just drop in the plugin. cache-loader is slightly trickier to set up, since you need to add it to each of your expensive loader chains separately, but it's still not that hard. So if you can, I'd suggest testing the performance of each one with your build. Remember to run webpack once to create the cache, and then again to check the performance with the cache in place.

I had trouble getting hard-source-webpack-plugin working with extract-text-css-plugin (possibly due to webpack-contrib/extract-text-webpack-plugin#612). Otherwise, the two are quite comparable.

This graph shows the performance results (initial and subsequent build, shorter is better) for our codebase, but as always YMMV:

hard-source_vs_cache-loader

from cache-loader.

bbrzoska avatar bbrzoska commented on May 30, 2024 1

You can use both, since generally you don't need to invalidate cache-loader as often as HardSource. The first one only when your loaders configuration or version changes, the second one you need to invalidate with any change of Webpack's config.

from cache-loader.

IAMtheIAM avatar IAMtheIAM commented on May 30, 2024

Hard source is slower intially for me by double but faster on rebuild by 2x-4x. Great. Same results as @sentience . .cache-loader is slower than default but not as slow as hard source on initial build. On rebuild, .cache-loader is faster but not as fast as hard source. Both are better than no cache! Im' going with hard-source for now, but keeping .cache-loader as a backup second place.

from cache-loader.

tarjei avatar tarjei commented on May 30, 2024

Closing this. Thanks for great responses!

from cache-loader.

stereokai avatar stereokai commented on May 30, 2024

Related: Please see a recent comparison of HardSource with DllPlugin (I wrote it)

from cache-loader.

fzxt avatar fzxt commented on May 30, 2024

@tarjei Did you find that these plugins actually help with speeding up karma-webpack for your case?

from cache-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.