Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are several possible reasons why the Angular bundle size may not decrease when utilizing nx monorepo with --prod and --build-optimizer:

  1. Unused Code: If your application contains unused code, it will not be eliminated by the build optimizer. Make sure to remove any unused code or libraries to reduce the bundle size.

  2. Third-Party Libraries: If you are using third-party libraries, their size may not be optimized unless they have been specifically designed to work with Angular's build optimizer.

  3. Assets: Assets such as images, fonts, and videos can significantly increase the bundle size. Make sure to optimize your assets by compressing and minifying them.

  4. Configuration: The build optimizer works best when used with the correct configuration. Verify that your configuration is correct by checking the angular.json file for any issues.

  5. Large Codebase: If your application has a large codebase, using the build optimizer may not result in a significant reduction in bundle size. You may need to consider other optimization techniques, such as lazy loading or code splitting.