-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
38 lines (37 loc) · 1008 Bytes
/
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
import { defineConfig } from "vite";
import environmentPlugin from "vite-plugin-environment";
import fullReload from "vite-plugin-full-reload";
import legacy from "@vitejs/plugin-legacy";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import path from "path";
import react from "@vitejs/plugin-react";
import { splitVendorChunkPlugin } from "vite";
export default defineConfig({
plugins: [
react(),
fullReload(["**/*.ts*", "**/*.js*", "**/*.mjs"], {
always: true,
root: "src",
}),
legacy(),
splitVendorChunkPlugin(),
nodePolyfills({
protocolImports: true,
}),
environmentPlugin("all", { loadEnvFiles: true, prefix: "CC_" }),
],
resolve: {
alias: {
"react/jsx-runtime": path.resolve(__dirname, "./lib/jsx-runtime"),
"react/jsx-dev-runtime": path.resolve(__dirname, "./lib/jsx-dev-runtime"),
},
},
build: {
target: "chrome87",
outDir: "build",
minify: "terser",
},
server: {
hmr: false,
},
});