Skip to content
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

Styles optimization option - "removeSpecialComments" is not working #27532

Closed
gopalpunvant opened this issue Apr 25, 2024 · 5 comments
Closed
Labels
needs: more info Reporter must clarify the issue

Comments

@gopalpunvant
Copy link

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

Yes

Description

Styles optimization option - "removeSpecialComments" is not working. This feature was merged in the PR: https://github.com/angular/angular-cli/pull/26444/files.

Screenshot 2024-04-25 200554

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Error: Schema validation failed with the following errors:
  Data path "/optimization/styles" must NOT have additional properties(removeSpecialComments).       
  Data path "/optimization/styles" must be boolean.
  Data path "/optimization/styles" must match exactly one schema in oneOf.
  Data path "/optimization" must be boolean.
  Data path "/optimization" must match exactly one schema in oneOf.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.3.5
Node: 20.11.1
Package Manager: npm 10.2.4
OS: win32 x64

Angular: 17.2.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.5
@angular-devkit/build-angular   17.3.5
@angular-devkit/core            17.3.5
@angular-devkit/schematics      17.3.5
@angular/cdk                    17.2.2
@angular/cli                    17.3.5
@schematics/angular             17.3.5
rxjs                            6.6.7
typescript                      5.2.2

Anything else?

No response

@JeanMeche JeanMeche transferred this issue from angular/angular Apr 25, 2024
@alan-agius4
Copy link
Collaborator

@gopalpunvant, this is only available when using the application builder.

Which builder are you using?

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Apr 25, 2024
@gopalpunvant
Copy link
Author

gopalpunvant commented Apr 29, 2024

@alan-agius4 For build, I am using only Angular CLI's "ng build --configuration production" command. "minify" option is working correctly. The configuration, I am using is:

"production": { "budgets": [ { "type": "anyComponentStyle", "maximumWarning": "6kb" } ], "optimization": { "scripts": true, "styles": { "minify": true, "inlineCritical": false, "removeSpecialComments": false }, "fonts": true }, "assets": [ "src/assets/scripts", "src/assets/favicon.ico" ], "outputHashing": "all", "sourceMap": false, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ] },

@alan-agius4
Copy link
Collaborator

@gopalpunvant, please provide the entire “build” section of your angular.json.

@gopalpunvant
Copy link
Author

@alan-agius4 I got you now. I am using "@angular-devkit/build-angular:browser" builder and I also saw that the "removeSpecialComments" is not available for it. So, is there any way to minimise the css while keeping the special comments as it is?

@alan-agius4
Copy link
Collaborator

@gopalpunvant, not with the browser builder.

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

2 participants