Question : Is it possible to run `npm start env.arbitrary`
See original GitHub issueI have multiple env. variables set in different files (external services keys etc…), and I’d like to run the app in development mode with each environment variable easily… Something like
npm start env.demo
npm start env.staging
npm start env.production
... etc
Is it currently possible with the CRA setup?
Thank you 🙏
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Using environment variables in npm scripts across platforms
I am building a package.json and use ...
Read more >npm-run-script
Description. This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
Read more >Utilizing npm Scripts During Development
One of the most useful ways to utilize npm scripts is to alter the value of Node's Node_ENV variable which is accessible in...
Read more >Three Things You Didn't Know You Could Do with npm ...
When you run a command or script through npm run... , your environment variables will automatically be augmented with a set of variables...
Read more >Using environment variables in a React application
Keep in mind that when building the application by running npm build , these variables will be embedded in the build so don't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use this same method for
npm start
: https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/template/README.md#customizing-environment-variables-for-arbitrary-build-environmentsI suspect the format might be to blame.
Can you try just uh:
Also, make sure these variables aren’t set in your shell already. Please open a new issue if you have a problem still!