feat(@angular-devkit/build-angular): add option to retain CSS special comments in global styles#26444
Merged
alan-agius4 merged 1 commit intoangular:mainfrom Nov 29, 2023
Conversation
Contributor
|
Thanks @alan-agius4, as always, providing an outstanding turnaround ! |
Contributor
|
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
Collaborator
Author
|
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
clydin
approved these changes
Nov 29, 2023
clydin
reviewed
Nov 29, 2023
..._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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
removeSpecialCommentsoption to enable retention of these comments in global CSS files.Usage example:
{ "projects": { "my-app": { "architect": { "build": { "builder": "@angular-devkit/build-angular:application", "configurations": { "production": { "optimization": { "styles": { "removeSpecialComments": false } } } } } } } } }Closes: #26432