-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
css file generated not generated in @import order #292
Comments
Hey @davidrojo! The good news is, I don't think you're doing anything wrong :). The bad news is, that this appears to be an old bug in extract-text-webpack-plugin: webpack-contrib/extract-text-webpack-plugin#200. Specifically, the mixing of the scss and css doesn't always result in the correct order. For now, I think you'll need to workaround the issue - e.g. by using all scss or all css. It appears that, when we're able to upgrade to Webpack v4 (we're waiting on some libraries we depend on to update), that the issue may go away then. Cheers! |
HI @weaverryan! I've changed my files to scss and now they are being imported in the correct order. I will have this in mind in the future. Thank you very much! |
I would add that it is also important to explicitly use the file extension when importing the file.
would result in the same mixed CSS content, even when all imported files are actual CSS files. |
@vladciulley Using the extension in that case (if you use the sass-loader) can have some unexpected side-effects though: #283 (comment) |
Hello, I think I am missing something, but when I generate a css file through importing other css files, they are not imported in the order that I've definedm so the styles are not properly overrided.
This is my webpack.config.js
And this is my main.scss file:
The output main.css file, should have bootstrap, then font awesome, then layout.css and the red.css, but when I open the main.css file generated it has at the begining font awesome, then layout.css then red.css and at the end the bootstrap code.
So, red.css and layout.css can't override bootstrap styles, as bootstrap is being added after them in the resulting css file.
What I am doing wrong?
The text was updated successfully, but these errors were encountered: