-
Notifications
You must be signed in to change notification settings - Fork 416
/
vite.config.ts
45 lines (43 loc) · 1.15 KB
/
vite.config.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
import { join } from "node:path"
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react-swc"
import { TanStackRouterVite } from "@tanstack/router-plugin/vite"
import unocss from "unocss/vite"
import unimport from "unimport/unplugin"
import dotenv from "dotenv"
import nitro from "./nitro.config"
import { projectDir } from "./shared/dir"
import pwa from "./pwa.config"
dotenv.config({
path: join(projectDir, ".env.server"),
})
export default defineConfig({
resolve: {
alias: {
"~": join(projectDir, "src"),
"@shared": join(projectDir, "shared"),
},
},
plugins: [
TanStackRouterVite({
// error with auto import and vite-plugin-pwa
// autoCodeSplitting: true,
}),
unimport.vite({
dirs: ["src/hooks", "shared", "src/utils", "src/atoms"],
presets: ["react", {
from: "jotai",
imports: ["atom", "useAtom", "useAtomValue", "useSetAtom"],
}],
imports: [
{ from: "clsx", name: "default", as: "$" },
{ from: "jotai/utils", name: "atomWithStorage" },
],
dts: "imports.app.d.ts",
}),
unocss(),
react(),
pwa(),
nitro(),
],
})