Fix: 修复依赖相关问题

This commit is contained in:
2025-08-08 17:42:41 +08:00
parent 18548ef9fb
commit 86a59aff1f
4 changed files with 787 additions and 693 deletions

View File

@ -18,10 +18,10 @@ ipcMain.on('play-sound', (_, soundFile) => {
// 判断是开发环境还是生产环境
if (process.env.NODE_ENV === 'development') {
// 开发环境下,路径指向 src
soundPath = path.join(__dirname, '../renderer/src/assets/sounds', soundFile);
// 开发模式下,直接指向 renderer/public 里的文件
soundPath = path.join(__dirname, '../renderer/public/assets/sounds', soundFile);
} else {
// 生产环境下,路径指向打包后的 dist 目录
// 生产模式下Vite 会把 public 里的文件复制到 dist 文件夹
soundPath = path.join(__dirname, '../renderer/dist/assets/sounds', soundFile);
}

1454
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,19 +19,17 @@
"url": "https://github.com/Kisechan/Pet/issues"
},
"homepage": "https://github.com/Kisechan/Pet#readme",
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.1",
"electron": "^37.2.5",
"vue": "^3.5.18",
"concurrently": "^8.0.0",
"vite": "^5.0.0",
"wait-on": "^7.0.0"
},
"dependencies": {
"electron": "^37.2.5",
"vue": "^3.5.18",
"fs-extra": "^11.3.1",
"howler": "^2.2.4",
"path": "^0.12.7"
"vue": "^3.5.18"
},
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.1",
"concurrently": "^9.2.0",
"cross-env": "^10.0.0",
"electron": "^37.2.6",
"vite": "^7.1.1",
"wait-on": "^8.0.4"
}
}

View File

Before

Width:  |  Height:  |  Size: 6.5 MiB

After

Width:  |  Height:  |  Size: 6.5 MiB