A way to define custom environment variables
See original GitHub issueThis may be a tiny yet non-obtrusive solution. Allow a custom .env.js
file that exports a key value pair used for custom webpack defines. I guess this wont be useful for many, since you any way get to refer to NODE_ENV but I also used this for defining a publicPath from an environment variable or defaulting to root. (useful for me as i had to run the same app for multiple quizzes, so I could build the frontend without configuring anything and having sane default not-get-in-the-way configs while development and testing)
Issue Analytics
- State:
- Created 7 years ago
- Comments:60 (32 by maintainers)
Top Results From Across the Web
Create Custom Environment Variables in Windows
By defining and setting up your own custom environment variables, you can create direct paths and shortcuts to apps, directories, URLs and more ......
Read more >7. Add custom environment variables - Devilbox documentation
7.1. Add custom environment variables¶ ... This is fairly simple. Any variable inside the .env file is considered an environment variable and automatically...
Read more >How To Create Custom Environment Variables In Windows 10
Type in sysdm.cpl in Run to open System Properties. · From the System Properties window, switch to the Advanced tab and then click...
Read more >How to Define Custom ENV Variables in Laravel? - DevDojo
A way to define environment variables in Linux would be to use the export command followed by the variable that you want to...
Read more >Adding Custom Environment Variables | Create React App
Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files. The environment variables are ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
I might have one. Let’s say there is api server running at different enviroments like so:
And I’m building SPA which supposed to use CORS and being hosted anywhere, just like static site.
And such I want to supply dev/prod absolute paths for different versions of SPA.
Hope this makes sense.
I think at that point you have a very advanced use case and ejecting is the way to go. I don’t think adding
.env
support by default is really necessary, since most users will never need it?