1

Since the introduction of npm ci some time ago, this is the recommended way for building applications - especially for CI environments and so on.

I have now the case where I am interested in specifying additional options (e.g. the base href) when making the prod build of my Angular (9) application. The command would be:

ng build --prod --baseHref=/frontend/

What would be the counterpart when using npm ci?

I have tried:

npm ci --only=production --baseHref=/frontend/

but it seems that the additional parameters are not passed through.

Anton Sarov
  • 3,712
  • 3
  • 31
  • 48

1 Answers1

2

npm ci only installs modules and does not invoke npm build

This command is similar to npm-install

for more information about the difference between npm i (npm install) and npm ci, refer to npm-ci documentation

this means that there is no connection to npm build and will not execute something like ng build --prod --baseHref=/frontend/

Mr.
  • 9,429
  • 13
  • 58
  • 82
  • Thank you, this means that I'll still need to trigger the ng build in addition and I save time "only" during modules installation – Anton Sarov Aug 14 '20 at 07:34