-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Angular cli changes css files order when build #9475
Comments
Please provide the output of |
ng --version:
|
When I open |
I have the same issue starting cli 1.6.4 (does not occurs on 1.7.0-beta3). |
I can confirm this issue exists in angular-cli 1.65, 1.6.6 and 1.6.7. If you reverse the order of your |
@clydin on 1.6.7, when I build with a styles array like below:
The CSS files are bundled with |
Reverting to 1.6.3 (and then installing |
|
@clydin I'm experiencing this issue with the Angular CLI v1.7.1 too. The styles array looks like this: "styles": [
"./app/shared/styles/material-theming.css",
"./app/shared/styles/styles.css"
], Yet, the CSS of This issue is marked with the label "need: more info". What other info can we provide that would help you debug this? |
I had the same problem while adding third-party CSS framework I wanted to extend. Finaly I just imported it through |
I had the same problem with 1.6.4 and switching to cli 1.7.4 fixed it. |
Did a clean I’m afraid “need: more info” label diverts attention away from this issue while |
Strangely, I notice that the styles are in the desired order when I run in dev mode, but in the wrong order when I run in production. |
Any update on this? |
@andresmgsl Not sure which version fixed this, but it's not present in 1.7.1, at least. |
I already reverted CLI twice because of this issue. 1.71 > 1.68 Same problem with 6.03 version now. Dev build is fine, prod build still not good. Related: #10579 |
I solved this issue by placing the css I wanted to import on top of styles.css instead of in the json file like recomended... |
This issue is still present in 6.0.5. Or at least in some form. I'm migrating an existing project to Angular CLI, and when disabling extractCss, it works as intended, while with extractCss enabled, the styles are broken. |
@nicolasfoisy can you please explain what you did there to solve it? |
Still present in 6.0.7. Setting extractCss to false fixes it for me too. |
Indeed issue is still present:
Angular CLI: 6.0.8 |
@ErazerBrecht I am using a .scss file with the imports of the third party style instead of the style.css and I am having the same issue, every time I run the command ng build --prod it create the dist folder but the style.css is like corrupted because all classes are together in 1 line and are not taking effect, same happens to the main.js file.😓😭 do you think I should change it back to the style.css? |
@clydin I also see a similar problem, but I build my application with custom webpack config. And CSS selectors is reorder when I have AngularCompilerPlugin in my pipeline. I'm created repository for showing this problem. In it you will see 2 directories ( I'm using: Angular CLI: 6.0.8 |
It turned out to fix the problem by transferring the import I'm uploaded this fix in fix-reorder branch |
Anyone else have a workaround for this issue? Setting extractCss doesn't seem to work for me either... Angular CLI 6.1.5. |
@Trojaan i fixed this issue with this |
@oneal1801 Thanks! This fixed it! :) |
Very strange bug. My temporary solution: moved all |
Any update on this bug. Thanks for the feedback |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When I check bundle after
ng build --prod --aot false
I found that css files order was modified by the build process.angular-cli.json
package.json
The text was updated successfully, but these errors were encountered: