Bird
0
0

After running ng build --stats-json, you cannot find the stats.json file. What is the most probable reason?

medium📝 Debug Q6 of 15
Angular - Performance Optimization
After running ng build --stats-json, you cannot find the stats.json file. What is the most probable reason?
AYou forgot to install <code>source-map-explorer</code>
BThe build output directory was changed, so the file is in a different folder
CThe Angular CLI version does not support <code>--stats-json</code>
DThe <code>ng build</code> command failed silently
Step-by-Step Solution
Solution:
  1. Step 1: Check output directory

    The stats.json file is generated inside the build output folder, which can be customized via --output-path.
  2. Step 2: Verify file location

    If the output path was changed, the file will not be in the default dist/ folder but in the specified directory.
  3. Final Answer:

    The build output directory was changed -> Option B
  4. Quick Check:

    Look for stats.json in the configured output folder [OK]
Quick Trick: Check output folder if stats.json is missing [OK]
Common Mistakes:
  • Assuming missing file means build failure
  • Confusing stats.json generation with source-map-explorer installation
  • Believing older Angular CLI versions never support stats-json

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes