A base Vue app that runs in the Electron environment for Balena Raspberry Pi deployment. It exposes the process.env environment variables and VUE_APP_* environment variables on the $env property of each Vue component, removing 'VUE_APP_' from the beginning of Vue app environment variable names.
For development the VUE_APP_* environment variables are stored in an .env file (typically .env.local) and in production the VUE_APP_* environment variables are in the Balena Cloud Environment Variables panel.
Problem: During development, Vue CLI 3 brings over the VUE_APP_* environment variables to process.env for the render process from the .env* files but when deployed to production Vue CLI 3 doesn't bring over the VUE_APP_* environment variables from the Balena device variables dashboard.
Solution: Since the VUE_APP_* environment variables are available in the main process (background.js), send a synchronous message to the render process (main.js) with the environment variables.
Based on balena-electron-vuecli3
Compiles and hot-reloads for development
yarn run serve
Compiles and minifies for production
yarn run build
Run your tests
yarn run test
Lints and fixes files
yarn run lint