DEV Community

Discussion on: Handling Command-line Arguments in NPM Scripts

Collapse
 
akhilgautam profile image
Akhil

Nicely explained but I contradict on the usage of last set of commands. The sole reason to write four different scripts is to reduce the pain of typing npm run serve --stage=development every time even in dev environment. Just my perception, you might have different views on it.

Collapse
 
felipperegazio profile image
Felippe Regazio • Edited

thats a fair point. in this case, i would prefer to add a new "serve:dev" with the proper stage flag. but I think it did its job as an example (?) :P another way would be to infer the 'development' mode on your application when there is no flag.