1

Initially I had implemented a single module per component, and module-based lazy-loading in my app. At that time my main.js bundle size was 2mb. Now I converted to all standalone components and implemented lazy loading for standalone components. Now my bundle size is 4mb. Any idea what can be the root problem or a solution? Has anyone else faced this issue?

  1. I verified the vendorChunk in build config, it's already true.
  2. I tried optimising the lazy loading as much as possible.
1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Mar 15, 2024 at 17:37

1 Answer 1

0

No, Angular's lazy loading feature does not reduce the bundle size, it only loads a fraction of the bundle (on demand) -AKA chunk- instead of loading it entirely. So for your case, bundle size wont decrease from 4MB, but also wont load 4MB at once.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.