-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ssg.ts
More file actions
32 lines (31 loc) · 909 Bytes
/
vite.config.ssg.ts
File metadata and controls
32 lines (31 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import path from "node:path";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { preventImports } from "./vite-plugins";
export default defineConfig(() => {
return {
resolve: {
alias: {
"@": path.resolve(__dirname, "."),
"~": path.resolve(__dirname, "./web"),
},
},
build: {
outDir: "dist-static",
emptyOutDir: true,
},
plugins: [
// Do not allow server code to be imported into the client build
preventImports({
fromFolder: path.resolve(__dirname, "web"),
folder: path.resolve(__dirname, "server"),
// For the Hono RPC to work correctly, we need to allow types to be
// imported from `server.ts` to the client code.
ignores: ["./server/server.ts"],
}),
react(),
tailwindcss(),
],
};
});