Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

0.15.0+ makes Webpack load slowly #124

Closed

Description

@ljconde

Ever since the 0.15.0 update, I've had to revert back to 0.14.5, because Webpack loads very slowly (12 secs vs almost 60 secs). Is there a breaking change I should be aware of? Maybe something regarding PostCSS?

Activity

  1. ljconde commented on Aug 13, 2015

    @ljconde
    Author

    Here's the webpack update output using css-loader 0.16.0 (same happens with 0.15.0+):

    Hash: 8d3652a9b4988c8ad221
    Version: webpack 1.11.0
    Time: 51612ms

    Here's the output with css-loader 0.14.5:

    Hash: bd471e6f4aa10b195feb
    Version: webpack 1.11.0
    Time: 6121ms

  2. BowlingX commented on Aug 31, 2015

    @BowlingX

    Same here, but I have more then 40 css (sass) modules, that take about 15 seconds with the old version and around 4 Minutes with the latest.

  3. added a commit that references this issue on Aug 31, 2015
  4. BowlingX commented on Sep 17, 2015

    @BowlingX

    still exists in 0.18, but its faster then the 0.16 build:

    0.18.0:

    Container#eachAtRule is deprecated. Use Container#walkAtRules instead.
    Container#eachRule is deprecated. Use Container#walkRules instead.
    Container#eachDecl is deprecated. Use Container#walkDecls instead.
    Hash: 0a92ccc4450f1a9a5193
    Version: webpack 1.12.0
    Time: 60275ms

    0.14.5

    Hash: 53d6260b86ff835b0eb1
    Version: webpack 1.12.0
    Time: 16196ms

  5. Phoenixmatrix commented on Sep 18, 2015

    @Phoenixmatrix

    Probably PostCSS, since that's the first thing that changed after 0.14.5, and that thing does a lot.

    IMO at this point CSS loader does too much. There's no real alternatives if you want url/import mapping and sourcemaps (raw-loader won't help with those), but to get those you have to pay the cost of all the bells and whistles. Is it time for a minimal css-loader that does just enough to pass stuff from the post-processors (like less-loader, sass-loader, etc) to style-loader as quickly as possible, with optional import/url support?

  6. jhnns commented on Oct 31, 2015

    @jhnns
    Contributor

    I agree @Phoenixmatrix. There are still a lot of people who only want imports and urls to be resolved which doesn't even require an actual parser imho.

    What do you think @sokra? Is it time to separate the css-loader from css-modules? Did I miss something?

  7. added a commit that references this issue on Nov 6, 2015
  8. sars commented on Dec 12, 2015

    @sars

    same problem...

  9. unindented commented on Jan 20, 2016

    @unindented

    Same problem here. With 0.14.5 build time is 60s, with 0.23.1 it is 90s.

  10. MoOx commented on Jan 27, 2016

    @MoOx

    poke @ai

  11. ai commented on Jan 27, 2016

    @ai
    Contributor

    New PostCSS is not slow then previous. But when you use depreacted PostCSS API it is of course slower, because it should print warning and call extra code.

    So, you should update webpack custom plugins for PostCSS 5.0 API (it is very simple) to remove all warnings. It will give a good speed boost.

  12. ai commented on Jan 27, 2016

    @ai
    Contributor

    Here is benchmarks: PostCSS 4.x vs. 5.0.

  13. ElegantScripting commented on Mar 24, 2016

    @ElegantScripting

    I'm having these issues too.

  14. goldensunliu commented on Mar 27, 2016

    @goldensunliu

    @ai do you know which calls in https://github.com/webpack/css-loader/blob/master/lib/processCss.js are deprecated? I would take a stab at it, but am having trouble finding any information on deprecated methods from 4.0

  15. goldensunliu commented on Mar 27, 2016

    @goldensunliu
  16. 63 remaining items

  17. alexander-akait commented on Feb 15, 2018

    @alexander-akait
    Member

    Feel free to PR, what speedup css loader

  18. yibn2008 commented on May 8, 2018

    @yibn2008

    If you don't need sourceMap and css module, you can try fast-css-loader, it use RegExp to parse @import and url(...), which will be faster than postcss.

  19. ai commented on May 8, 2018

    @ai
    Contributor

    @yibn2008 note, that regexp is not a safe way for CSS since CSS could contain a string (inlined SVG?) or comments with directives inside.

    But it is a good idea to improve css-loader. Maybe we could try to create a css-loader fork with PostCSS (it’s parser is very fast), but without all features. Maybe CSS Modules is used every time and slow down the process?

  20. yibn2008 commented on May 8, 2018

    @yibn2008

    @ai I have handled comments in css, but inline SVG haven't been tested. I'll try to use postcss alone later to see is the performance improved.

  21. alexander-akait commented on May 8, 2018

    @alexander-akait
    Member

    @ai it is in our plans in future, if somebody started this i can help

  22. alexander-akait commented on Dec 3, 2018

    @alexander-akait
    Member

    In next major release (will be release in next future):

    • We implement reusing ast from postcss-loader (increase perf)
    • We implement logic for disable css modules plugins (modules: false, by default css modules disabled, you can avoid modules: false), it is allow increase perf, if you don't use css modules.

    Feel free to open issue if you have ideas how we can increase perf more

  23. ZuBB commented on Dec 3, 2018

    @ZuBB

    @evilebottnawi will be any limitation for minimal required version of webpack for this new release of css-loader?

  24. alexander-akait commented on Dec 4, 2018

    @alexander-akait
    Member

    @ZuBB webpack@4, but you can ignore peerDependencies warning and use in webpack@3

  25. ZuBB commented on Dec 4, 2018

    @ZuBB

    hi @evilebottnawi!

    Sorry to persist but I see in "BREAKING CHANGES" section of v1.0.0 next statement

    minimum require webpack version is 4

    considering this do you think your statement on webpack@3 & next css-loader is still valid?

  26. alexander-akait commented on Dec 4, 2018

    @alexander-akait
    Member

    @ZuBB we avoid using old webpack version due a lot of bugs, but no new api used in css-loader@1, also no used new api in webpack@2 (next release) so it should be work, but i recommended upgrade your webpack

  27. ZuBB commented on Dec 4, 2018

    @ZuBB

    thanks for reply @evilebottnawi! I got your point

  28. added a commit that references this issue on Oct 22, 2019
  29. added a commit that references this issue on Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions