Angular project directory too large

Viewed 894

I am a beginner with Angular and I know almost nothing about it. I created a simple CRUD app, however, my project file size turned out to be 400MB+ which doesn't make sense.
I have no idea how to reduce it. I am guessing I downloaded libraries that I don't use?

2 Answers

400 MB is fine, I am writing this since ng new app from Angular CLI itself creates around 370-400MB node_modules.

If you are concerned about the performance,

I would suggest you to do ng build --prod and check all the generated .js files inside your dist folder.

If you find your main.js and others to be less, then no need to worry.

I cannot comment on the ideal main.js size however I personally ensure it to be around 500-750Kb.

Besides this, I recommend you to keep an eye on you package.json dependencies and remove unwanted deps as too many unwanted deps will potentially increase your npm install time.

when you create an angular project, it downloads about 400MB of code for node_modules, but all of that code is technically "outside" your project. It's not part of your project. Your project is under the "src" folder. or if you do a build, it will be under the "dist" folder.

Related