Defining unused Angular modules in the app.module.ts file

I have inherited an angular application that imports everything under the sun, forcing vendor.bundle.js to be 8 MB.

Is there a utility that allows me to know which modules are not used and can be removed?

Or does AOT take care of this?

Also, do I need to delete the node_modules folder if there is no import associated with it? Or will it not hurt to leave him there, because AOT still will not accept him?

+2
source share
1 answer

, AOT , NgModule. , ( node_modules), . , .

TypeScript,

--noUnusedLocals , TypeScript. AOT, , , , AOT, .

, . , , .

, Angular , , . , , , , CLI .

+1

Source: https://habr.com/ru/post/1693874/


All Articles