You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
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?
Reacted by Mark Penner, Michael, Sandor, Eliseu Monar dos Santos, Kewin Brandsma, Alexander Akait, David Burke, Jonny Reeves, Yojan Shrestha, Spain and 26 more
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
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?
Reacted by FrendEr, Michel Vidailhet, Tyler Paul Thompson, Chris Fritz, Clinton Blackburn, Mikail Bagishov, Owen Kelly, Will Colton, Kevin Koshiol, Greg Venech and 3 more
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?
Reacted by Sandor, CP Clermont, Eugene and Greg Venech
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.
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.
@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?
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
@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
Activity
ljconde commentedon Aug 13, 2015
Here's the webpack update output using css-loader 0.16.0 (same happens with 0.15.0+):
Here's the output with css-loader 0.14.5:
BowlingX commentedon Aug 31, 2015
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.
due performance issues webpack/css-loader#124, downgrade css plugin
BowlingX commentedon Sep 17, 2015
still exists in 0.18, but its faster then the 0.16 build:
0.18.0:
0.14.5
Phoenixmatrix commentedon Sep 18, 2015
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?
jhnns commentedon Oct 31, 2015
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?
Bump css-loader to 0.14 series
sars commentedon Dec 12, 2015
same problem...
unindented commentedon Jan 20, 2016
Same problem here. With
0.14.5build time is 60s, with0.23.1it is 90s.MoOx commentedon Jan 27, 2016
poke @ai
ai commentedon Jan 27, 2016
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.
ai commentedon Jan 27, 2016
Here is benchmarks: PostCSS 4.x vs. 5.0.
ElegantScripting commentedon Mar 24, 2016
I'm having these issues too.
goldensunliu commentedon Mar 27, 2016
@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
goldensunliu commentedon Mar 27, 2016
I am not seeing anything in the source code that is deprecated based on this change log on deprecation
https://github.com/postcss/postcss/blob/0873667be6d65dafb1d2a3650ce87cd1f3fec204/CHANGELOG.md#50-president-valac
63 remaining items
alexander-akait commentedon Feb 15, 2018
Feel free to PR, what speedup css loader
yibn2008 commentedon May 8, 2018
If you don't need sourceMap and css module, you can try fast-css-loader, it use RegExp to parse
@importandurl(...), which will be faster than postcss.ai commentedon May 8, 2018
@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?
yibn2008 commentedon May 8, 2018
@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.
alexander-akait commentedon May 8, 2018
@ai it is in our plans in future, if somebody started this i can help
alexander-akait commentedon Dec 3, 2018
In next major release (will be release in next future):
astfrompostcss-loader(increase perf)cssmodules plugins (modules: false, by defaultcssmodules disabled, you can avoidmodules: false), it is allow increase perf, if you don't usecssmodules.Feel free to open issue if you have ideas how we can increase perf more
ZuBB commentedon Dec 3, 2018
@evilebottnawi will be any limitation for minimal required version of webpack for this new release of css-loader?
alexander-akait commentedon Dec 4, 2018
@ZuBB
webpack@4, but you can ignorepeerDependencieswarning and use inwebpack@3ZuBB commentedon Dec 4, 2018
hi @evilebottnawi!
Sorry to persist but I see in "BREAKING CHANGES" section of v1.0.0 next statement
considering this do you think your statement on
webpack@3& next css-loader is still valid?alexander-akait commentedon Dec 4, 2018
@ZuBB we avoid using old
webpackversion due a lot of bugs, but no new api used incss-loader@1, also no used new api inwebpack@2(next release) so it should be work, but i recommended upgrade your webpackZuBB commentedon Dec 4, 2018
thanks for reply @evilebottnawi! I got your point
Downgrade css-loader requirement
Downgrade css-loader requirement