Skip to content

Commit 45bd231

Browse files
committed
fix: 临时修复无法打包svg的问题
1 parent 8b4ccc1 commit 45bd231

File tree

115 files changed

+113
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+113
-32
lines changed

electron/ipc/window.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BrowserWindow, ipcMain } from "electron";
1+
import { BrowserWindow } from "electron";
22

33
export default function setupWindowIpcHandlers(win: BrowserWindow | null) {
44

@@ -10,7 +10,7 @@ export default function setupWindowIpcHandlers(win: BrowserWindow | null) {
1010
// ----------------- Set 系列操作(使用 win.webContents 绑定) -----------------
1111

1212
if (checkWindow()) {
13-
win.webContents.on("ipc-message", (event, channel, ...args) => {
13+
win.webContents.on("ipc-message", (_event, channel, ...args) => {
1414
// 根据 channel 处理 set 操作
1515
switch (channel) {
1616
// 改变窗口大小

electron/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ function createNewWindow(
5959
if (VITE_DEV_SERVER_URL) {
6060
const fullUrl = `${VITE_DEV_SERVER_URL}#${finalRoute}`;
6161
newWin.loadURL(fullUrl);
62-
newWin.webContents.openDevTools();
62+
6363
} else {
6464
const indexPath = path.join(RENDERER_DIST, "index.html");
6565
newWin.loadFile(indexPath, { hash: finalRoute });
6666
}
67+
newWin.webContents.openDevTools();
6768

6869
// 窗口加载完成后显示并发送消息
6970
newWin.webContents.on("did-finish-load", () => {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
"vite": "^5.1.6",
3838
"vite-plugin-electron": "^0.28.6",
3939
"vite-plugin-electron-renderer": "^0.14.5",
40+
"vite-plugin-svgr": "^4.3.0",
4041
"vue-tsc": "^2.0.26"
4142
},
4243
"main": "dist-electron/main.js",
4344
"build-icon": "electron-icon-builder --input=./public/favicon.png --output=public --flatten"
44-
}
45+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)