mirror of
https://github.com/CarlGao4/um-react-electron.git
synced 2024-11-23 22:02:17 +00:00
update
This commit is contained in:
parent
64b94ad7e2
commit
fcdcbfb21c
@ -23,6 +23,7 @@
|
|||||||
git clone https://git.unlock-music.dev/um/um-react.git && npm install --frozen-lockfile
|
git clone https://git.unlock-music.dev/um/um-react.git && npm install --frozen-lockfile
|
||||||
cd ../ && npm install
|
cd ../ && npm install
|
||||||
npm run start / npm run dev
|
npm run start / npm run dev
|
||||||
|
npm run start / npm run dev
|
||||||
```
|
```
|
||||||
- 打包
|
- 打包
|
||||||
```sh
|
```sh
|
||||||
|
11
package.json
11
package.json
@ -8,12 +8,13 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint": "eslint --ext .js .",
|
"lint": "eslint --ext .js .",
|
||||||
"dev": "cd um-react && npm run start & electron .",
|
"dev": "cd um-react && npm run build && cp -r ./dist ../src/renderer && cd ../ && electron .",
|
||||||
"start": "cd um-react && npm run start & electron .",
|
"start": "cd um-react && npm run build && cp -r ./dist ../src/renderer && cd ../ && electron .",
|
||||||
"postinstall": "electron-builder install-app-deps",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"build:win": "cd um-react && npm run build && cd ../ && electron-builder --win --config",
|
"build": "cd um-react && npm run build && cp -r ./dist ../src/renderer && cd ../",
|
||||||
"build:mac": "cd um-react && npm run build && cd ../ && electron-builder --mac --config",
|
"build:win": "cd um-react && npm run build && cp -r ./dist ../src/renderer && cd ../ && electron-builder --win --config",
|
||||||
"build:linux": "cd um-react && npm run build && cd ../ && electron-builder --linux --config"
|
"build:mac": "cd um-react && npm run build && cp -r ./dist ../src/renderer && cd ../ && electron-builder --mac --config",
|
||||||
|
"build:linux": "cd um-react && npm run build && cp -r ./dist ../src/renderer && cd ../ && electron-builder --linux --config"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron-toolkit/preload": "^2.0.0",
|
"@electron-toolkit/preload": "^2.0.0",
|
||||||
|
12
src/main.js
12
src/main.js
@ -38,12 +38,12 @@ function createWindow() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
console.log(app.isPackaged)
|
// console.log(app.isPackaged)
|
||||||
if (!app.isPackaged) {
|
// if (!app.isPackaged) {
|
||||||
mainWindow.loadURL('http://localhost:5173')
|
// mainWindow.loadURL('http://localhost:5173')
|
||||||
} else {
|
// } else {
|
||||||
mainWindow.loadFile(path.join(__dirname, 'renderer/index.html'))
|
mainWindow.loadFile(path.join(__dirname, 'renderer/index.html'))
|
||||||
}
|
// }
|
||||||
|
|
||||||
mainWindow.on('closed', () => {
|
mainWindow.on('closed', () => {
|
||||||
// 在窗口关闭时触发before-quit事件以结束进程
|
// 在窗口关闭时触发before-quit事件以结束进程
|
||||||
|
Loading…
Reference in New Issue
Block a user