You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.1 KiB
59 lines
1.1 KiB
// vite.config.ts
|
|
import { defineConfig } from "vite"
|
|
import electron from "vite-plugin-electron"
|
|
import react from "@vitejs/plugin-react"
|
|
import path from "path"
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
electron([
|
|
{
|
|
// main.ts
|
|
entry: "electron/main.ts",
|
|
vite: {
|
|
build: {
|
|
outDir: "dist-electron",
|
|
sourcemap: true,
|
|
minify: false,
|
|
rollupOptions: {
|
|
external: ["electron"]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
// preload.ts
|
|
entry: "electron/preload.ts",
|
|
vite: {
|
|
build: {
|
|
outDir: "dist-electron",
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
external: ["electron"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
])
|
|
],
|
|
base: process.env.NODE_ENV === "production" ? "./" : "/",
|
|
server: {
|
|
port: 54321,
|
|
strictPort: true,
|
|
watch: {
|
|
usePolling: true
|
|
}
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
sourcemap: true
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src")
|
|
}
|
|
}
|
|
})
|