fix: dev.mjs linux/mac 无法启动开发环境

在 isWindows 分支中,startElectronVite 函数正常启动
在 else 分支中,startElectronVite 函数在定义之前就被调用了
This commit is contained in:
MoYingJi
2025-10-22 02:41:33 +08:00
parent f238845f9b
commit ef6868fd40

View File

@@ -41,10 +41,10 @@ if (isWindows) {
console.log(`🐧 ${isMacOS ? "macOS" : "Linux"} 环境 - 正在设置 UTF-8 编码`);
env.LC_ALL = "en_US.UTF-8";
env.LANG = "en_US.UTF-8";
startElectronVite();
setTimeout(() => startElectronVite(), 0);
}
const startElectronVite = () => {
console.log("🔧 正在启动 Electron Vite 开发服务器...");