打包参数
This commit is contained in:
parent
c0b6b7afd1
commit
fb05838a68
13
main.js
13
main.js
|
|
@ -29,6 +29,7 @@ let regKey;
|
||||||
let connection = null;
|
let connection = null;
|
||||||
let envStr;
|
let envStr;
|
||||||
let startNumber = 0;
|
let startNumber = 0;
|
||||||
|
let buildStatus = false; //true 打包开发版本 false 本地开发
|
||||||
powerSaveBlocker.start('prevent-display-sleep')
|
powerSaveBlocker.start('prevent-display-sleep')
|
||||||
const id = powerSaveBlocker.start('prevent-display-sleep')
|
const id = powerSaveBlocker.start('prevent-display-sleep')
|
||||||
powerSaveBlocker.stop(id)
|
powerSaveBlocker.stop(id)
|
||||||
|
|
@ -53,7 +54,11 @@ class AppWindow extends BrowserWindow {
|
||||||
super(finalConfig);
|
super(finalConfig);
|
||||||
if (env === 'development') {
|
if (env === 'development') {
|
||||||
// 开发
|
// 开发
|
||||||
this.loadURL('http://localhost:3000');
|
if (buildStatus) {
|
||||||
|
this.loadFile(path.resolve(__dirname, './dist/index.html'));
|
||||||
|
} else {
|
||||||
|
this.loadURL('http://localhost:3000');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 测试 | 生产
|
// 测试 | 生产
|
||||||
this.loadFile(path.resolve(__dirname, './dist/index.html'));
|
this.loadFile(path.resolve(__dirname, './dist/index.html'));
|
||||||
|
|
@ -584,7 +589,11 @@ app.on('ready', () => {
|
||||||
})
|
})
|
||||||
if (envStr === 'development') {
|
if (envStr === 'development') {
|
||||||
// 开发
|
// 开发
|
||||||
child.loadURL(config.url)
|
if (buildStatus) {
|
||||||
|
child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`);
|
||||||
|
} else {
|
||||||
|
child.loadURL(config.url)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 测试 | 生产
|
// 测试 | 生产
|
||||||
child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`);
|
child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue