1

The in package.json file of an angular there is a section for npm scripts and a section for dependencies. In our project we use parameters for our ng serve command. The values depend on the devs machine. The respective line in the package.json looks something like

"start": "ng serve --host MyComputer --sslKey SomeFileOnMyMachine

Since the values are individual we don't want them to get into our repository. But since we need to commit the dependencies section below we can't throw the file into the .gitignore. This leads this line sneaking its way into our repository frequently.

I found that you can pass parameters to the scripts. But it's not really feasable to type out the parameters every time.

Is it possible to separate the scripts and the dependencies in a way that allows convenient execution of the scripts while preventing them beeing accidentially commited to our repository?

  • Still looking for an answer – GrimmReaper Apr 12 '21 at 13:57
  • We found out, that it is possible to put the parameters in the angular.json file under `projects -> clientApp -> architect -> serve -> options` . Still not optimal but since angular.json changes less frequently, the accidential checkins are reduced. – GrimmReaper Oct 11 '21 at 06:48

0 Answers0