-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@angular-devkit/build-angular): add option to retain CSS special comments in global styles #26444
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
feat(@angular-devkit/build-angular): add option to retain CSS special comments in global styles #26444
Conversation
Thanks @alan-agius4, as always, providing an outstanding turnaround ! |
Hi guys, just for our information, is this planned to be merged at some point soon? No rush at all, it is because this is holding us back from release the upgrade to Angular 17. Thanks! |
4de7d4c
to
b945a57
Compare
Had a chat with @clydin earlier last week and we decided to go with an additional option. The PR has been updated to add this option. This should be available as part of 17.1.0. |
b945a57
to
5084dbe
Compare
..._angular/src/builders/application/tests/options/optimization-remove-special-comments_spec.ts
Outdated
Show resolved
Hide resolved
… comments in global styles Prior to this change special CSS comments `/*! comment */` were being removed during minification when using the application builder. This caused tools that ran post build that rely on such comments such as purgeCSS and critters not to function properly. We now provide a `removeSpecialComments` option to enable retention of these comments in global CSS files. Usage example: ```json { "projects": { "my-app": { "architect": { "build": { "builder": "@angular-devkit/build-angular:application", "configurations": { "production": { "optimization": { "styles": { "removeSpecialComments": false } } } } } } } } } ``` Closes: angular#26432
5084dbe
to
c8578a1
Compare
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. |
Prior to this change special CSS comments
/*! comment */
were being removed during minification when using the application builder. This caused tools that ran post build that rely on such comments such as purgeCSS and critters not to function properly.We now provide a
removeSpecialComments
option to enable retention of these comments in global CSS files.Usage example:
Closes: #26432