Is it necessary for a build server to remove node_modules before an AOT build?
I am currently dealing with an Angular application that is being deployed using an CI orchestrator and Jenkins.
Jenkins job is configured to do the following (relevant steps only):
- fetch sources from Git
- remove node_modules
- perform AOT build (
--prod+ other optimizations)
I have noticed that node_modules removal +
npm install + AOT build takes way more time than simply calling
npm install + perform AOT build, so I am wondering why the removal.
I have asked a few colleagues about this configuration and no one seems to know why the removal is required.
From what I know, removing node_modules is very rarely required (maybe some major update messes up some packages or similar) and I haven't removed any node_modules for any project in years (development environment).
So, is it necessary for a build server to remove node_modules before an AOT build?