Skip to content

Angular CLI 8.3.0: scripts.js not minified for prod build #15489

@cooljeffro

Description

@cooljeffro

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 8.2.2

Description

After upgrading to Angular CLI 8.3.0, after making a prod build, the scripts.js file is larger. Local variable names are not being minified

🔬 Minimal Reproduction

  1. Create a new project with ng new.
  2. Create a simple test.js file in the project root with the follow content:
function testFunction() {
  var longVariableName = Date.now();
  console.log(longVariableName);
}
  1. In angular.json, set scripts to ["test.js"].
  2. Run ng build --prod.
  3. In the output scripts.[hash].js, local variable names are not minified.

Angular CLI 8.2.2 output:

function testFunction(){var n=Date.now();console.log(n)}

Angular CLI 8.3.0 output:

function testFunction(){var longVariableName=Date.now();console.log(longVariableName)}

🌍 Your Environment


Angular CLI: 8.3.0
Node: 10.14.1
OS: win32 x64
Angular: 8.2.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.0
@angular-devkit/build-angular     0.803.0
@angular-devkit/build-optimizer   0.803.0
@angular-devkit/build-webpack     0.803.0
@angular-devkit/core              8.3.0
@angular-devkit/schematics        8.3.0
@angular/cli                      8.3.0
@ngtools/webpack                  8.3.0
@schematics/angular               8.3.0
@schematics/update                0.803.0
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions