Questions regarding how to use electron or vue are likely to be closed as they are not direct issues with this boilerplate. Please seek solutions from official documentation or their respective communities.
#
# Install vue-cli and scaffold boilerplate
npm install -g vue-cli
vue init simulatedgreg/electron-vue my-project
# Install dependencies and run your app
cd my-project
npm install
npm run build:web
then open ~/my-project/dist/web/index.html with google chrome, catch exception
Uncaught ReferenceError: process is not defined
at index.html:1
# Install vue-cli and scaffold boilerplate
npm install -g vue-cli
vue init simulatedgreg/electron-vue my-project
# Install dependencies and run your app
cd my-project
npm install
npm run build:web

This isn't an issue. The boilerplate template uses process to get the current node and electron versions, but since those don't exist in a web browser you are getting this error. In your real app, where this original landing page doesn't exist anymore, you won't have this error log.
Hay,How do I inject js to access variables by building different environments?
What I am now is
build.js
require('./build-config') //add
build-config
'use strict'
const config = require('../config/index.js')
const CONFIG_NAME = process.env.CONFIG_NAME || 'dev'
process.env.CONFIG = "custom cfg"
for (let i in config[CONFIG_NAME]) {
process.env['CONFIG_' + i] = config[CONFIG_NAME][i]
}
package.json => scripts
"build:alpha": "cross-env CONFIG_NAME=alpha node .electron-vue/build.js && electron-builder",
and js use variables
const service = axios.create({
baseURL: process.env.CONFIG_BASE_API,
contentType: 'application/json',
method:'get',
withCredentials: false,
timeout: 15000
});
use npm run dev can work,
but use npm run build run app does't work
Print via console process.env

thks~
Sorry @SimulatedGREG but how is this not an issue? The project provides a way to build for the web that isnt working because of process not being defined?
In my case dotenv-webpack is not working as well.
Most helpful comment
Sorry @SimulatedGREG but how is this not an issue? The project provides a way to build for the web that isnt working because of process not being defined?