if(process.env.WEBPACK_DEV_SERVER_URL) {//如果处于开发模式,请加载开发服务器的urlawait mainWindow.loadURL(process.env.WEBPACK_DEV_SERVER_URL)if(!process.env.IS_TEST) mainWindow.webContents.openDevTools() }else{ createPr
// 创建一个函数来创建窗口,winConfig是BrowserWindow的配置,devPath是开发时的地址,prodPath是打包后文件地址 function createWindow(winConfig, devPath, prodPath) { const win = new BrowserWindow(winConfig) if (process.env.WEBPACK_DEV_SERVER_URL) { win.loadURL(process.env.WEBPACK_DEV_SERVER_URL + dev...
if (process.env.WEBPACK_DEV_SERVER_URL) { // Load the url of the dev server if in development mode await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL) if (!process.env.IS_TEST) win.webContents.openDevTools() } else { createProtocol('app') // Load the index.html when not in d...
mainWindow.loadURL('https://jspang.com') }) // 开启devTool // mainWindow.webContents.openDevTools() // 加载窗口的URL -> 来自renderer进程的页面 // mainWindow.loadURL(winURL) mainWindow.loadURL("http://106.12.123.173/#/dic") mainWindow.maximize() // 关闭devTool mainWindow.webContents.cl...
const { defineConfig } = require('@vue/cli-service');module.exports = defineConfig({ transpileDependencies: true, lintOnSave: false, devServer: { host: 'localhost', port: 9001, // https:true }, publicPath: './', chainWebpack: (config) => { //最小化代码 con...
function createWindow(devPath, prodPath) { // Create the browser window. let window = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION, enableRemoteModule:true } }) if (process.env.WEBPACK_DEV_SERVER_URL) { // Load the...
env.WEBPACK_DEV_SERVER_URL + '#/update') } else { win.loadURL('app://./index.html#/update') } } autoUpdater.on('download-progress', res => { log.info("下载监听:" + res) win.webContents.send('downloadProgress', res) }) autoUpdater.on('update-downloaded', () => { dialog....
"render": "webpack-dev-server --hot --colors --config .electron-vue/webpack.renderer.config.js --port 9080 --content-base ./" 启动脚本,然后再启动调试,界面就出来啦, 打包之路 Electron-vue集成了electron-builder和electron-packager,初始化工程是可以选择其中任意一种,本工程选择的是electron-builder...
loadURL(process.env.WEBPACK_DEV_SERVER_URL); if (!process.env.IS_TEST) win.webContents.openDevTools(); } else { createProtocol("app"); // Load the index.html when not in development win.loadURL("app://./index.html"); } win.on("closed", () => { win = null; }); } // ...
process.env.ELECTRON_NODE_INTEGRATION } }) // 根据开发环境加载不同的内容 if (process.env.WEBPACK_DEV_SERVER_URL) { await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL) if (!process.env.IS_TEST) win.webContents.openDevTools() } else { createProtocol('app') win.l...