Skip to content

source maps should not be included in initial budgets #11999

Closed
@StephenFluin

Description

@StephenFluin

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [x] build

Versions

Angular CLI: 6.2.0-rc.0
Node: 9.2.0
OS: linux x64
Angular: 6.1.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.8.0-rc.0
@angular-devkit/build-angular 0.8.0-rc.0
@angular-devkit/build-optimizer 0.8.0-rc.0
@angular-devkit/build-webpack 0.8.0-rc.0
@angular-devkit/core 0.8.0-rc.0
@angular-devkit/schematics 0.8.0-rc.0
@angular/cdk 6.4.6
@angular/cli 6.2.0-rc.0
@angular/material 6.4.6
@ngtools/webpack 6.2.0-rc.0
@schematics/angular 0.8.0-rc.0
@schematics/update 0.8.0-rc.0
rxjs 6.2.2
typescript 2.7.2
webpack 4.17.1

Repro steps

ng new my-app
yarn add @angular/cli@next @angular-devkit/build-angular@next
add budget to angular.json:

               {
                  "type": "initial",
                  "maximumWarning": "200kb",
                  "maximumError": "500kb"
                }

increase bundle size to warning level 400kb by adding material and polyfills
ng build --prod --source-map=true

The log given by the failure

$ ng build --prod --source-map=true
 92% after chunk asset optimization SourceMapDevToolPlugin runtime.06daa30a2963fa413676.js generate Sourc 92% after chunk asset optimization SourceMapDevToolPlugin main.1ba4d9420e44e4ba5c29.js generate SourceMa 92% after chunk asset optimization SourceMapDevToolPlugin polyfills.4e368c32ecca0224e378.js generate Sou 92% after chunk asset optimization SourceMapDevToolPlugin styles.02b6018b0906cde5eb2a.css generate Sourc 92% after chunk asset optimization SourceMapDevToolPlugin styles.a00195f40656efc2be54.js generate Source 92% after chunk asset optimization SourceMapDevToolPlugin runtime.06daa30a2963fa413676.js attach SourceM 92% after chunk asset optimization SourceMapDevToolPlugin polyfills.4e368c32ecca0224e378.js attach Sourc 92% after chunk asset optimization SourceMapDevToolPlugin styles.02b6018b0906cde5eb2a.css attach SourceM 92% after chunk asset optimization SourceMapDevToolPlugin styles.a00195f40656efc2be54.js attach SourceMa                                                          
Date: 2018-08-24T17:45:50.308Z
Hash: 02cf7346246f12f19bc6
Time: 26814ms
chunk {0} runtime.06daa30a2963fa413676.js, runtime.06daa30a2963fa413676.js.map (runtime) 1.5 kB [entry] [rendered]
chunk {1} main.1ba4d9420e44e4ba5c29.js, main.1ba4d9420e44e4ba5c29.js.map (main) 249 kB [initial] [rendered]
chunk {2} polyfills.4e368c32ecca0224e378.js, polyfills.4e368c32ecca0224e378.js.map (polyfills) 147 kB [initial] [rendered]
chunk {3} styles.02b6018b0906cde5eb2a.css, styles.02b6018b0906cde5eb2a.css.map (styles) 56.2 kB [initial] [rendered]

WARNING in budgets, maximum exceeded for initial. Budget 200 kB was exceeded by 2.71 MB.

ERROR in budgets, maximum exceeded for initial. Budget 500 kB was exceeded by 2.41 MB.

Desired functionality

Source maps should not be included in initial bundle size calculation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions