November 2019
Beginner
436 pages
8h 52m
English
We are going to use the DEBUG environment variable as an indicator that the application needs to connect to a local development server. Let's learn how to enable this in application scripts:
{ "scripts": { "serve": "vue-cli-service serve", "start": "DEBUG=true electron .", "build": "vue-cli-service build", "lint": "vue-cli-service lint" },}
For Windows users, the start script should look as follows:
{ "start": "SET DEBUG=true && electron ."}
if (process.env.DEBUG) { // load from running server ...Read now
Unlock full access