-
-
Notifications
You must be signed in to change notification settings - Fork 384
Order trouble when importing CSS files from a css file #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm having the same problem :/ |
+1 |
I'm not sure, I've got to try but maybe this version could fix that. https://github.com/webpack-contrib/mini-css-extract-plugin/releases/tag/v0.4.1
|
@kud feel free to feedback |
Yep, I'll certainly do, thanks. ;) |
I can confirm the issue with current git master. Please find a test case attached. Nested imports are not output in the correct order. |
Work around : importing them via JS, not CSS. But it shouldn't be like that, yeah. |
Same thing here. Plugin version 0.4.3. But I have css imports along side with scss imports. As the result all css after export appears at the end of file, even if the was imported at start of main.scss |
Same here. It seems that another workaround is to just rename all the CSS files into SCSS files, e.g. from |
@kud it seems that issue was introduced for me with Not sure if it's been addressed in subsequent releases. I had to revert to pre |
I tried to reproduce your issue, but was unable to find any issue. Note that https://drafts.csswg.org/css-cascade-3/#at-ruledef-import
But we still allow it and hoist it to the top of the file. So in cases like: // 1.css
.b {}
@import "./2.css";
.c {}
// 2.css
.a {} This results in: .a {}
.b {}
.c {} |
@sokra issue happening not because of import in the middle of css or scss files. In my case I have single entry scss file, that imports all styles. It looks similar to this @import "some_css.css";
@import "some_scss"; And there is no styles in this entry, except imports After export source from css file will be added at the end of exported file, even if it was imported first |
Why was this closed? The problem is still there in version 0.5.0.. The order seems to be honored inside one file type, but is sometimes different over several file types. To illustrate (simplified extract from my project): /* in main.less */
@import "~bootstrap/less/bootstrap.less";
@import "../custom.css"; With this setup my output has the content of /* in main.less */
@import "~bootstrap/less/bootstrap.less";
@import "../custom.less"; So obviously the order does not get honored over file type boundaries... |
Same problem here.
log:
|
Having this issue as well in v0.7.0. Given the stylesheet:
All contents of .css files are included first, then .scss in the single extracted file. I would expect the contents to be included in the order of the |
@nilsglow sorry for delay, can you open issue with reproducible test repo, thanks! |
I've got for instance this:
index.js
:index.css
:I'll got a unordered
index.css
at the end.But if I do this:
index.js
:It will be ok.
Do you have any idea why?
tl;dr: Order isn't kept when importing from css files, contrary to js files.
The text was updated successfully, but these errors were encountered: