-
Notifications
You must be signed in to change notification settings - Fork 513
4.0.0-beta.0 adding a loader changes the order of generated CSS #745
Comments
I'm having a similar issue when upgrading to Webpack 4 and extract text beta-0. I'm using PostCSS Loader with CSS modules. In development without extract text everything works as expected, although in prod when using extract text I see a duplication of the same compiled CSS module classes in the bundle and a regression in order of some classes. This seems to be happening in combination with using the
ex. the following css most likely occurs in various files throughout the application resulting in class duplication and changes in order @import 'config/common.css';
@import 'config/header.css';
.container {
position: relative;
}
.cta-text {
composes: heading-4 from 'helpers/typography.css';
} This problem is in a large repo and I'm having problems replicating it in a minimal use case but when I do I will post a demo. |
@dtothefp have you tried the Mini Css Extract Plugin ? |
@garygreen yes I tried it after reading your response in other issues. Couldn't get it to work with PostCSS loader 🤷♂️ |
@garygreen I was wrong...I did get the mini-css / loader plugin to work and CSS classes are NOT duplicated and are in the correct order 😄. Unfortunately, this is in a large app that is using |
@dtothefp sounds like you need to configure the |
@garygreen looks definitely interesting but hard to understand the config. I tried something like below but it had no effect. I feel like I'm not figuring out how to test for the CSS chunks
|
TL;DR Use The |
Why has this issue been closed? This is still not resolved. If we plan not to support webpack 4 at all, why don't we add a NOTE to README, that indicates that people should use Right now there's a ETWP 4.0 beta which confuses a lot of users, that this plugin is suited for webpack 4, while unfortunately, atm it's not. Switching to mini-css-extract-plugin takes a second, so it's not a big trouble while upgrading to webpack 4. |
I'm using 4.0.0-beta.0. Without
postcss-loader
added below, I get the expected behavior, where the extracted css fromvue-loader
is appended to the end of the final css file. But adding 'postcss-loader' puts the extracted css to the beginning of the final css file which isn't correct.The text was updated successfully, but these errors were encountered: