diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..c2e3d4d --- /dev/null +++ b/build/index.js @@ -0,0 +1,12 @@ +import { execSync } from 'child_process'; +import os from 'os'; + +execSync('vite build'); + +const platform = os.platform(); + +if (platform === 'darwin') { + execSync('electron-builder --mac --win --linux'); +} else { + execSync('electron-builder --win --linux'); +} diff --git a/package.json b/package.json index 285f78b..1f14014 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "dist-electron/main.js", "scripts": { "dev": "vite", - "build": "vite build && electron-builder --mac --win --linux", + "build": "node build/index.js", "buildapp": "vite build && electron-builder --mac --win --linux", "preview": "vite preview" },