0

My team has recently begun building an Angular 6 application and we are relatively new to the modern JavaScript framework world.

Our CI builds are currently using the Angular CLI to build the app with the configuration flag set to production: ng build -c production

Before the build, however, our build engineer wants to install just the necessary dependencies and NOT include the items in the devDependencies section of the package.json file... but libraries required to perform the build are only in the devDependencies section. The command he's using is yarn install --production. Again this ignores dependencies in devDependencies.

My question is this: when building an Angular 6 app for production, should we:

  • use the Angular CLI, but move the build dependencies from devDependencies to the nominal dependencies section?
  • don't use the Angular CLI, leave the dependencies as they are, and do something entirely separate
null
  • 153
  • 1
  • 3
  • 16
  • 1
    DevDependencies are needed to build the application but are not included in the output of the app. So devDependencies ARE required if you want to build your application. – jriver27 Oct 05 '18 at 20:16

1 Answers1

0

You should use Angular CLI command, ng build to generate a compiled js file and use it with your index.html as a static page then deploy it.

T.Liu
  • 492
  • 1
  • 5
  • 16
  • yep, it may be is unclear but in fact deployng means mostly put dist dir (with compiled js and index on it) online after `ng build`. – netalex Nov 23 '18 at 10:28