Skip to content

@angular-devkit/build-angular v0.803.5 increased the bundle size! #15663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mehmet-erim opened this issue Sep 24, 2019 · 3 comments
Closed

@angular-devkit/build-angular v0.803.5 increased the bundle size! #15663

mehmet-erim opened this issue Sep 24, 2019 · 3 comments
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@mehmet-erim
Copy link

mehmet-erim commented Sep 24, 2019

🐞 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: @angular-devkit/build-angular: 0.802.2

Description

I have updated Angular packages versions 8.2.2 to 8.2.7 and @angular-devkit/build-angular 0.802.2 to 0.803.5. Then I built the project with production configuration. My bundle size increased ~700kb. I recorded a video..

I have Angular NPM libraries. I load these modules lazily via a wrapper module.
My lazy load technique shown below:

app-routing.module.ts:

  {
    path: 'account',
    loadChildren: () => import('./lazy-libs/account-wrapper.module').then(m => m.AccountWrapperModule),
  },

account-wrapper.module.ts:

import { NgModule } from '@angular/core';
import { AccountModule } from '@volo/abp.ng.account';

@NgModule({
  imports: [AccountModule],
})
export class AccountWrapperModule {}

🔬 Minimal Reproduction

ng new repro-app --routing --style=scss

cd repro-app && yarn build --prod

Chunk sizes:

chunk {0} runtime-es2015.85f895af57b038f1e5b4.js (runtime) 2.82 kB [entry] [rendered]
chunk {1} main-es2015.2cad38873c3952b85f28.js (main) 367 kB [initial] [rendered]
chunk {2} polyfills-es2015.0fe6949bc5ff4b784062.js (polyfills) 64 kB [initial] [rendered]
chunk {3} polyfills-es5-es2015.a83ac866abc867bfd530.js (polyfills-es5) 222 kB [initial] [rendered]
chunk {4} styles.09e2c710755c8867a460.css (styles) 0 bytes [initial] [rendered]

And then change the @angular-devkit/build-angular as shown below:
package.json:

 "devDependencies": {
   "@angular-devkit/build-angular": "~0.802.2",
   "@angular/cli": "~8.3.5",
     ...

Run the yarn command.

After the installation, rebuild the project.

yarn build --prod

Check the chunk sizes:

chunk {0} runtime-es2015.23d5cfd07e19f065eceb.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main-es2015.562c67bb724c07a2dc78.js (main) 245 kB [initial] [rendered]
chunk {2} polyfills-es2015.121760cf7f523c213c13.js (polyfills) 36.4 kB [initial] [rendered]
chunk {3} styles.09e2c710755c8867a460.css (styles) 0 bytes [initial] [rendered]

First build: (main) 367 kB
Second build: (main) 245 kB

🌍 My Environment


Angular CLI: 8.3.5
Node: 10.16.0
OS: darwin x64
Angular: 8.2.7
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.5
@angular-devkit/build-angular     0.803.5
@angular-devkit/build-optimizer   0.803.5
@angular-devkit/build-webpack     0.803.5
@angular-devkit/core              8.3.5
@angular-devkit/schematics        8.3.5
@angular/cdk                      8.2.0
@angular/cli                      8.3.5
@ngtools/webpack                  8.3.5
@schematics/angular               8.3.5
@schematics/update                0.803.5
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2
@alan-agius4
Copy link
Collaborator

This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Sep 24, 2019
@clydin
Copy link
Member

clydin commented Sep 24, 2019

Duplicate of #15425

Please check the actual on disk sizes. This is a display issue only.

@clydin clydin closed this as completed Sep 24, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

3 participants