mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
refactor: move from next js to vite and tanstack router
This commit is contained in:
57
apps/ui/vite.config.mts
Normal file
57
apps/ui/vite.config.mts
Normal file
@@ -0,0 +1,57 @@
|
||||
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",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user