I would like to know if there is a tool to track packages that are present in the final build of an angular project.
For example : I have a package "@angular/compiler" which is a dependency of the package.json but not a dev dependency.
As mentioned on the angular docs https://angular.io/guide/aot-compiler#ahead-of-time-aot-compilation with AOT compiler code is already compiled, unlike JIT compiler. In my understanding, it means that the final build does not need @angular/compiler as a dependency if the flag AOT is set for the final build.
Is my reasoning is correct?
You can see exactly what ends up in the production bundle by using a tool called webpack-bundle-analyzer.
--stats-json
flag: ng build --prod --stats-json
npx webpack-bundle-analyzer dist/{your-project-name}/stats.json
which will open a browser window with an interactive chart displaying the included dependencies (you can even search for a specific module).