-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
Description
Follow up to issue: #19812
Sorry for the late creation of the example repo
I think I found a bug in Angular compiler: It is about the optimization flag in the angular.json file.
As soon as I set the flag to false, a sample scss file with 70 lines of code has a size of 20kb. Variables are also imported in this file. Only variables and mixins are imported and no other css code. The variable file is about 400 lines in size and estimated 10 of the 400 variables are used in the scss file in question.
If I replace the variables with the values in the file and remove the import, the file falls below my warning size of 8kb. Angular version 11.1.11 is used.
If I set the optimization flag to true, the the size of the example scss file with variable imports is also smaller than the 8kb warning size.
Sizes of the example scss file:
optimization flag false: 20 kb
optimization flag true: < 2 kb
🔬 Minimal Reproduction
Here is the example repo: https://github.com/tobiasanton123/angular-optimization-flag
The stepts to reproduce are described in the README.md
The name of the example scss file is home.scss and is located in pages/home
🌍 Your Environment
Angular CLI: 11.1.1
Node: 12.18.0
OS: darwin x64
Angular: 11.1.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1101.1
@angular-devkit/build-angular 0.1101.1
@angular-devkit/core 11.1.1
@angular-devkit/schematics 11.1.1
@angular/cli 11.1.1
@schematics/angular 11.1.1
@schematics/update 0.1101.1
rxjs 6.6.3
typescript 4.1.3