From ec3dd6740598e957407370b4be502d499cd86a44 Mon Sep 17 00:00:00 2001 From: "min.liu05" Date: Tue, 23 Oct 2018 17:31:24 +0800 Subject: [PATCH 1/2] fix bugs: 1. `process.env.NODE_ENV` get undefined when `npm run lint` 2. won't lint `no-debugger` when `npm run lint` --- template/.electron-vue/dev-runner.js | 2 ++ template/.eslintrc.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/template/.electron-vue/dev-runner.js b/template/.electron-vue/dev-runner.js index 51633de4..0dcb7e8c 100644 --- a/template/.electron-vue/dev-runner.js +++ b/template/.electron-vue/dev-runner.js @@ -1,5 +1,7 @@ 'use strict' +process.env.NODE_ENV = 'production' + const chalk = require('chalk') const electron = require('electron') const path = require('path') diff --git a/template/.eslintrc.js b/template/.eslintrc.js index 77eeefe9..ae241466 100644 --- a/template/.eslintrc.js +++ b/template/.eslintrc.js @@ -37,6 +37,7 @@ module.exports = { 'no-multi-assign': 0, {{/if_eq}} // allow debugger during development - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 + // `process.env.NODE_ENV` will get `undefined` when `npm run lint` + 'no-debugger': process.env.NODE_ENV === 'development' ? 0 : 2 } } From 3535d5bef97d73c8cd34ae28bb8e1ab2feb35197 Mon Sep 17 00:00:00 2001 From: snovey Date: Fri, 2 Nov 2018 11:13:37 +0800 Subject: [PATCH 2/2] Update dev-runner.js sorry for my careless --- template/.electron-vue/dev-runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.electron-vue/dev-runner.js b/template/.electron-vue/dev-runner.js index 0dcb7e8c..e4f00156 100644 --- a/template/.electron-vue/dev-runner.js +++ b/template/.electron-vue/dev-runner.js @@ -1,6 +1,6 @@ 'use strict' -process.env.NODE_ENV = 'production' +process.env.NODE_ENV = 'development' const chalk = require('chalk') const electron = require('electron')