When working on a big JavaScript project your package script section will usually end up looking crazy. Let’s use Node to make it a little less overwhelming.

Let’s do this!

Start by adding a small Node.js script to the root of your project and call it start.js

Edit const choices with the targets you need,

with the targets you need, Replace process.env.REACT_APP_TARGET with the name of the environment variable you use to distinguish between targets.

From here change your package.json scripts to:

Now running npm start will now let you choose the target you need 🎉

This way you will have a much neater script section, and while the example is written with react it is just as easily applied to Angular, React Native or whichever JavaScript framework you are using. I have added the full example to GitHub.