Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

How to use process.env in the render #1106

Open
anson2004 opened this issue Aug 9, 2021 · 0 comments
Open

How to use process.env in the render #1106

anson2004 opened this issue Aug 9, 2021 · 0 comments

Comments

@anson2004
Copy link

Hello,

I have separated staging and production environments so I define custom system env for our electron-vue application.

And I create a build script in package.json and try to use cross-env to specify the custom system env value.

Here is a example in package.json
"build-prod": "cross-env API_URL=abc.com AUTH_URL=auth.io node .electron-vue/build.js && electron-builder",

But after I run "npm run build" and install it, these system env is not set up in vue application.

Could I ask is there a better way to set up system env in vue application so I can use "process.env" in the vue code and get correct value?

Br, Yiqing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant