electron-vue icon indicating copy to clipboard operation
electron-vue copied to clipboard

How to use process.env in the render

Open anson2004 opened this issue 4 years ago • 0 comments
trafficstars

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

anson2004 avatar Aug 09 '21 10:08 anson2004