diff --git a/index.js b/index.js index 7c06b28..18a3afa 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,11 @@ * */ +if (process.env.NODE_ENV === 'development') + console.log('%cKawAnime is running in development mode.', + 'color:green; ' + + 'font-size:13px;') + const path = require('path') window.Vue = require(path.join(__dirname, 'node_modules', 'vue', 'dist', 'vue.js')) diff --git a/main.js b/main.js index d00e9ab..c3d65f5 100644 --- a/main.js +++ b/main.js @@ -16,6 +16,11 @@ let mainWindow let newsWindow const BASE_PATH = os.userInfo().homedir +if (process.env.NODE_ENV === 'hotDevelopment') + require('electron-reload')(__dirname, { + electron: path.join(__dirname, 'node_modules', '.bin', 'electron') + }) + function createWindow() { // Create the directory to download files const dir = path.join(BASE_PATH, '.KawAnime') @@ -61,7 +66,12 @@ function createWindow() { // Some APIs can only be used after this event occurs. app.on('ready', () => { createWindow() - if (process.env.NODE_ENV !== 'production') require('vue-devtools').install() + + // Dev tools + if (process.env.NODE_ENV !== 'production') + { + require('vue-devtools').install() + } }) // Quit when all windows are closed. diff --git a/package.json b/package.json index fe6687f..3622279 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "main": "main.js", "scripts": { "start": "electron .", + "dev": "NODE_ENV=development electron .", + "hotDev": "NODE_ENV=hotDevelopment electron .", "pack": "build --dir", "dist": "build -mwl", "helpBuild": "echo 'https://github.com/electron-userland/electron-builder#cli-usage'" @@ -20,7 +22,9 @@ "license": "MIT", "devDependencies": { "electron": "^1.4.15", - "electron-builder": "^15.4.3" + "electron-builder": "^15.6.2", + "electron-reload": "^1.1.0", + "vue-devtools": "^3.0.8" }, "dependencies": { "find-remove": "^1.0.0", @@ -32,7 +36,6 @@ "parse-torrent": "^5.8.1", "play-sound": "^1.1.1", "request": "latest", - "vue-devtools": "^3.0.8", "vue-material": "^0.7.1" }, "build": {