x)
- [ ] new
- [x ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
The BUG is presented in previous version as well.
Unused (not imported) modules of angular library are included to build made in production mode. Everything is generated by cli, nothing were changed manually. Reproduction is below.
https://github.com/yansokalau/angular-library-test project where the issue can be reproduced, steps are described here
@angular-devkit/architect 0.7.5
@angular-devkit/build-angular 0.7.5
@angular-devkit/build-optimizer 0.7.5
@angular-devkit/build-webpack 0.7.5
@angular-devkit/core 0.8.9
@angular-devkit/schematics 0.8.9
@angular/cdk 7.3.0
@angular/cli 7.0.7
@angular/material 7.3.0
@angular/pwa 0.8.9
@ngtools/webpack 6.1.5
@schematics/angular 0.8.9
@schematics/update 0.10.7
rxjs 6.4.0
typescript 3.1.6
webpack 4.9.2
Please let me know if more information is required. Thank you.
@filipesilva linked isue is https://github.com/angular/angular-cli/issues/13082
Didn't get response there so creating a separate one.
Hey @yansokalau I did see you added a repro to #13082 but haven't had time to look into it to see if it's the same as https://github.com/angular/angular-cli/issues/13082#issuecomment-456459729.
Also related to: https://github.com/angular/angular-cli/issues/13635
Hello @filipesilva,
Any updates?
Any progress on this topic? Working a library where developers can pick and choose what to import without bunding the entire list of components they might never use. This issue is kind of a big deal.
can we expect a fix of this before v9 (before ivy)?
In my monorepo where I have four libs, the output of some apps is immense, because the app is using from each lib one or more component or services and finally I have all the libs (the whole lib) in my bundle
Upon examination of the reproduction, it appears that the vendorChunk option was enabled in the production configuration for the application (link). This option is intentionally disabled for production builds. The underlying bundler (Webpack) cannot perform an overwhelming majority of its optimizations with this setting enabled. The vendorChunk option is only intended to be used for development scenarios to minimize rebuild time in watch or serve mode.
By reverting the option to its original state of disabled, the problem described is no longer present.
Closing the issue as this appears to be a project configuration issue rather than a systemic defect. If anyone is encountering similar issues but not related to the vendorChunk option, please open a new issue describing the problem and providing a minimal reproduction where possible.
@clydin It's just a simple example. The issue is not related to vendorChunk, because we're using false in our project.

The issue as reported was due to the option and the example demonstrated this. As noted above, if anyone is encountering issues not related to the option, please open a new issue with details and a minimal reproduction. Also please ensure the latest actively supported version of the CLI is used as any issue encountered may already have been corrected.
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._
Most helpful comment
Any progress on this topic? Working a library where developers can pick and choose what to import without bunding the entire list of components they might never use. This issue is kind of a big deal.