Loading src/app.js→app.dev.js +2 −14 Original line number Diff line number Diff line Loading @@ -3,19 +3,7 @@ const app = electron.app const BrowserWindow = electron.BrowserWindow const contextMenu = require('electron-context-menu'); const isDev = process.env.NODE_ENV === 'DEV'; var isWin = process.platform === "win32"; let url console.log(process.env.NODE_ENV) if (isDev) { console.log("Loading from localhost") url = 'http://localhost:8080/' } else { console.log("Loading from dist") url = `file://${process.cwd()}/dist/index.html` } let url = 'http://localhost:8080/' app.on('ready', () => { let window = new BrowserWindow({width: 1124, height: 800}) Loading @@ -24,7 +12,7 @@ app.on('ready', () => { contextMenu({ showCopyImageAddress: true, showSaveImageAs: true, showInspectElement: isDev, showInspectElement: true, }); window.loadURL(url) Loading app.js 0 → 100644 +28 −0 Original line number Diff line number Diff line const electron = require('electron') const contextMenu = require('electron-context-menu'); const path = require('path') const app = electron.app const BrowserWindow = electron.BrowserWindow const isDev = (process.env.NODE_ENV === 'DEV'); let url = `file://${path.join(__dirname, '/dist/index.html')}` app.on('ready', () => { let window = new BrowserWindow({ width: 1124, height: 800, icon: path.join(__dirname, '/src/assets/icons/png/64x64.png') }) window.setMenu(null); contextMenu({ showCopyImageAddress: true, showSaveImageAs: true, showInspectElement: isDev, }); window.loadURL(url) }) No newline at end of file Loading
src/app.js→app.dev.js +2 −14 Original line number Diff line number Diff line Loading @@ -3,19 +3,7 @@ const app = electron.app const BrowserWindow = electron.BrowserWindow const contextMenu = require('electron-context-menu'); const isDev = process.env.NODE_ENV === 'DEV'; var isWin = process.platform === "win32"; let url console.log(process.env.NODE_ENV) if (isDev) { console.log("Loading from localhost") url = 'http://localhost:8080/' } else { console.log("Loading from dist") url = `file://${process.cwd()}/dist/index.html` } let url = 'http://localhost:8080/' app.on('ready', () => { let window = new BrowserWindow({width: 1124, height: 800}) Loading @@ -24,7 +12,7 @@ app.on('ready', () => { contextMenu({ showCopyImageAddress: true, showSaveImageAs: true, showInspectElement: isDev, showInspectElement: true, }); window.loadURL(url) Loading
app.js 0 → 100644 +28 −0 Original line number Diff line number Diff line const electron = require('electron') const contextMenu = require('electron-context-menu'); const path = require('path') const app = electron.app const BrowserWindow = electron.BrowserWindow const isDev = (process.env.NODE_ENV === 'DEV'); let url = `file://${path.join(__dirname, '/dist/index.html')}` app.on('ready', () => { let window = new BrowserWindow({ width: 1124, height: 800, icon: path.join(__dirname, '/src/assets/icons/png/64x64.png') }) window.setMenu(null); contextMenu({ showCopyImageAddress: true, showSaveImageAs: true, showInspectElement: isDev, }); window.loadURL(url) }) No newline at end of file