-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
54 lines (52 loc) · 1.4 KB
/
Copy pathvite.config.ts
File metadata and controls
54 lines (52 loc) · 1.4 KB
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
46
47
48
49
50
51
52
53
54
import { fileURLToPath } from "node:url";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
const rootDirectory = fileURLToPath(new URL(".", import.meta.url));
const pierreShiki = fileURLToPath(new URL("./lib/pierre-shiki.ts", import.meta.url));
const pierreThemes = fileURLToPath(new URL("./lib/pierre-themes.ts", import.meta.url));
export default defineConfig({
root: "app",
envDir: "..",
plugins: [react(), tailwindcss()],
server: {
proxy: {
"/eve": {
changeOrigin: true,
target: "http://127.0.0.1:4879",
},
},
},
resolve: {
alias: [
{ find: "shiki/wasm", replacement: pierreShiki },
{ find: /^shiki$/, replacement: pierreShiki },
{ find: "@pierre/theming/themes", replacement: pierreThemes },
{ find: "@", replacement: rootDirectory },
],
},
optimizeDeps: {
exclude: ["@pierre/diffs"],
include: ["lru_map"],
},
build: {
outDir: "../dist",
emptyOutDir: true,
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{
name: "react",
test: /node_modules\/(?:react|react-dom|react-router|scheduler)\//,
},
{
name: "session-runtime",
test: /node_modules\/(?:convex|eve)\//,
},
],
},
},
},
},
});