-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
vite.config.ts
45 lines (42 loc) · 1.3 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 react from "@vitejs/plugin-react";
import react from "@vitejs/plugin-react-swc";
import { visualizer } from "rollup-plugin-visualizer";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vite";
import copyMonaco from "./vite/copyAssets";
import alias from "@rollup/plugin-alias";
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3000,
},
plugins: [react(), copyMonaco(), tsconfigPaths()],
build: {
target: ["chrome95", "edge95", "esnext", "firefox95", "safari16"],
sourcemap: false,
rollupOptions: {
plugins: [
alias({
entries: [
{ find: "react", replacement: "preact/compat" },
{ find: "react-dom/test-utils", replacement: "preact/test-utils" },
{ find: "react-dom", replacement: "preact/compat" },
{ find: "react/jsx-runtime", replacement: "preact/jsx-runtime" },
],
}),
visualizer(),
],
output: {
sourcemap: false,
manualChunks: {
"rehype-parse": ["rehype-parse"],
"rehype-raw": ["rehype-raw"],
"react-markdown": ["react-markdown"],
"quicktype-core": ["quicktype-core"],
quicktype: ["quicktype"],
lodash: ["lodash"],
},
},
},
},
});