-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 956 Bytes
/
Copy pathvite.config.ts
File metadata and controls
32 lines (31 loc) · 956 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 { viteImage } from "@son426/vite-image/plugin";
import tailwindcss from "@tailwindcss/vite";
import { devtools } from "@tanstack/devtools-vite";
import { tanstackRouter } from "@tanstack/router-plugin/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
devtools(),
tanstackRouter({ target: "react", autoCodeSplitting: true }),
react(),
tailwindcss(),
viteImage(),
],
resolve: {
tsconfigPaths: true,
},
build: {
rolldownOptions: {
output: {
manualChunks(id) {
if (!id.includes("node_modules")) return;
const [, pkgPath = ""] = id.split(/node_modules[\\/]/);
const [scopeOrName, maybeName] = pkgPath.split(/[\\/]/);
if (!scopeOrName) return;
return scopeOrName.startsWith("@") && maybeName ? `${scopeOrName}/${maybeName}` : scopeOrName;
},
},
},
},
});