-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix
Milestone
Description
🐞 Bug report
Command (mark with an x
)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Yes
Description
Tree-shaking not working as expected
🔬 Reproducing steps
- download below sample
-
run "npm i"
-
then give "ng build --prod"
check build source-
In that, "main-es5.js" and "main-es2015.js" has all modules, no tree shaking.
check string [getModuleName=function()] in bundle file , you can find it 61 times which means all other modules are imported even if they are not used. This shows unused classes are not getting tree-shaken.
🔥 Exception or Error
While using GridAllModule , build size is 1.8mb
While using GridModule which has less no of imported class, build size is same.
🌍 Your Environment
"@angular/animations": "~8.2.0",
"@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0",
"@angular/forms": "~8.2.0",
"@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0",
"@angular-devkit/build-angular": "~0.802.0",
"@angular/cli": "~8.2.0",
"@angular/compiler-cli": "~8.2.0",
"@angular/language-service": "~8.2.0",
@angular-devkit/[email protected]
Metadata
Metadata
Assignees
Labels
freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix