Skip to content

Importing BrowserAnimationsModule increases size by 80kB #10918

@scttcper

Description

@scttcper

Versions

Angular CLI: 6.0.3
Node: 10.0.0
OS: darwin x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@angular/cli                      6.0.3
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3

Steps

  1. Create new project ng new pj
  2. Add BrowserAnimationsModule in app.module and add it to imports
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

size before with ng build --prod

chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.34c57ab7888ec1573f9c.css (styles) 0 bytes [initial] [rendered]
chunk {2} polyfills.b4daf421c94934f530d4.js (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.f4b01ffa884caa16bbde.js (main) 155 kB [initial] [rendered]

size after

chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.34c57ab7888ec1573f9c.css (styles) 0 bytes [initial] [rendered]
chunk {2} polyfills.b4daf421c94934f530d4.js (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.3a8d9503b82e0a5c7782.js (main) 235 kB [initial] [rendered]

main.js increased from 155 kB to 235 kB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions