mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
import * as path from "path";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { defineConfig } from "vite";
|
|
import electron from "vite-plugin-electron/simple";
|
|
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
|
import { fileURLToPath } from "url";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
electron({
|
|
main: {
|
|
entry: "src/main.ts",
|
|
vite: {
|
|
build: {
|
|
outDir: "dist-electron",
|
|
rollupOptions: {
|
|
external: ["electron"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
preload: {
|
|
input: "src/preload.ts",
|
|
vite: {
|
|
build: {
|
|
outDir: "dist-electron",
|
|
rollupOptions: {
|
|
external: ["electron"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}),
|
|
TanStackRouterVite({
|
|
target: "react",
|
|
autoCodeSplitting: true,
|
|
routesDirectory: "./src/routes",
|
|
generatedRouteTree: "./src/routeTree.gen.ts",
|
|
}),
|
|
tailwindcss(),
|
|
react(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
},
|
|
});
|