set env variable to the packed app ?
See original GitHub issue- Version: 19.22.1
- Target: Windows (NSIS)
Hi, I try to make an app with electron-builder
and I neet to set NODE_ENV=production
.
I use cross-env
to set it, I try to put it on my scripts (start, pack and dist) but doesn’t work.
Any idea how can I do this ? Do I miss something ?
I made this temporally fix but if any way exist to add env variable to the packed app, it can be awesome !
if (process.env.NODE_ENV == undefined) process.env.NODE_ENV = "production"
Thank’s in advance !
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (3 by maintainers)
Top Results From Across the Web
How do I set NODE_ENV=production on Electron app when ...
You can always set that env variable in your application like this: process.env.NODE_ENV = 'production' . You could integrate that with electron ...
Read more >Environment variables - Cloud Native Buildpacks
Environment variables are a common way to configure various buildpacks at build-time. Below are a few ways you can do so. All of...
Read more >Environment Variables - Electron
Certain Electron behaviors are controlled by environment variables ... NODE_OPTIONS are explicitly disallowed in packaged apps, except for the following:.
Read more >Environment Variables: What They Are and How To Use Them
Environment Type: Environment variables are often used to store the name of the environment in which the app is currently running. The app's...
Read more >Use environment variables | Cloud Run Documentation
The environment variables defined in the container runtime contract are reserved and cannot be set. In particular, the PORT environment variable is injected ......
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
Late reply but yes, in my app I’m simply doing
mainWindow.loadURL(...)
but these need to be pointed to different deploy targets…localhost, staging, pilot, etc., prod.@alexandermckay that’d work if you only had two environments as the docs suggest. If you have like three or more you need something else.