Reputation: 53
I have an Electron app (built with Vue.js) that I would like to have both a production
build as well as a development
build.
Ideally, I would configure my application to use the NODE_ENV
environment variable to modify the apps behavior once packaged.
This is primarily for testing auto updates. I want to have a packaged version of the application that points to my dev endpoints, and not to our production endpoints so that we can ensure we aren't rolling out breaking changes to our users.
I can't figure out how to set the NODE_ENV variable as development
when using electron builder (via the vue-cli-electron-builder) to build a packaged app.
Thanks!
Upvotes: 2
Views: 1276
Reputation: 53
I was able to solve this simply by passing the --mode development
flag to the vue-cli.
Hopefully this helps someone!
Example:
vue-cli-service electron:build --mode development
Upvotes: 3