Bird
0
0

If your Angular app's bundle remains large despite removing unused components, which issue might be blocking tree shaking?

medium📝 Debug Q6 of 15
Angular - Performance Optimization
If your Angular app's bundle remains large despite removing unused components, which issue might be blocking tree shaking?
AEnabling Ahead-of-Time compilation
BUsing Angular CLI for building the app
CImporting entire libraries instead of specific modules
DUsing lazy loading for feature modules
Step-by-Step Solution
Solution:
  1. Step 1: Identify common tree shaking blockers

    Importing entire libraries prevents removal of unused code.
  2. Step 2: Understand other options

    Angular CLI, AOT, and lazy loading help reduce bundle size, not block tree shaking.
  3. Final Answer:

    Importing entire libraries instead of specific modules -> Option C
  4. Quick Check:

    Whole-library imports block tree shaking [OK]
Quick Trick: Avoid full library imports to enable tree shaking [OK]
Common Mistakes:
  • Blaming Angular CLI or AOT for bundle size
  • Ignoring import styles
  • Assuming lazy loading increases bundle size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes