I've generated a project with the Angular CLI ng new my-dream-app and I've noticed that I get the following dependency structure in package.json
{
"dependencies": {
"@angular/animations": "~8.2.11",
"@angular/common": "~8.2.11",
"@angular/compiler": "~8.2.11",
"@angular/core": "~8.2.11",
"@angular/forms": "~8.2.11",
"@angular/platform-browser": "~8.2.11",
"@angular/platform-browser-dynamic": "~8.2.11",
"@angular/router": "~8.2.11",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.14",
"@angular/cli": "~8.3.14",
"@angular/compiler-cli": "~8.2.11",
"@angular/language-service": "~8.2.11",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}
}
Now imagine that I'm using the CLI generated project with a backend framework (e.g., expressjs) that handles static assets. Furthermore, imagine that I want to deploy my app at some cloud service.
I can build locally the static assets and then move the entire project to the cloud where I would run npm i --production to install only the dependencies and then run npm start
However, I don't want to install any Angular-related libs at cloud. I only want to install strictly what's necessary to run my app (express, body-parser, cookie-parser etc.).
Now the actual question: will CLI still work properly if I manually move Angular's dependencies to devDependencies? Things like ng update? Would it move back some dependencies from devDependencies to dependencies? Would it create duplicate entries?