Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

376
Visualizações
Angular 2 and Angular Cli tree shaking production build, vendor.js huge

I have done a small Angular 4 app, but I do not know how to apply tree shaking and aot compiling. the command I run is the following:

ng build --prod --aot

But the result I get is still huge, vendor file is 2.63Mb:

Hash: 3f2f9863802ffee21a18
Time: 35397ms
chunk    {0} polyfills.3be44b11f98572593d31.bundle.js (polyfills) 158 kB {4} [initial] [rendered]
chunk    {1} main.62b1e2f835ae0e344351.bundle.js (main) 537 kB {3} [initial] [rendered]
chunk    {2} styles.6ad044d12ab50a9da898.bundle.css (styles) 69 bytes {4} [initial] [rendered]
chunk    {3} vendor.a13d6c29b7348e1ae91d.bundle.js (vendor) 2.63 MB [initial] [rendered]
chunk    {4} inline.01f2c419c67f5155d8a3.bundle.js (inline) 0 bytes [entry] [rendered]

Is this the final application, or something is wrong with ng cli?

This is my version of the CLI:

@angular/cli: 1.0.0-rc.4
node: 6.10.0
os: win32 x64
@angular/common: 4.0.0-rc.6
@angular/compiler: 4.0.0-rc.6
@angular/core: 4.0.0-rc.6
@angular/forms: 4.0.0-rc.6
@angular/http: 4.0.0-rc.6
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.6
@angular/platform-browser-dynamic: 4.0.0-rc.6
@angular/router: 4.0.0-rc.6
@angular/cli: 1.0.0-rc.4
@angular/compiler-cli: 4.0.0-rc.6
about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Angular 4 prod build with tree shake and aot can be acheived by just running ng build --prod --aot flag not required now.

Build should look like this ( chunk {5} vendor.46351c4e9fc678f82bca.bundle.js (vendor) 1.13 MB [initial] [rendered] )

Note: in this output 1.13MB is not what you get, look your file size in /dist directory what you get is 316KB )

build output

what we get

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda