forked from marmelab/atomic-crm
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.demo.config.ts
More file actions
57 lines (56 loc) · 1.31 KB
/
vite.demo.config.ts
File metadata and controls
57 lines (56 loc) · 1.31 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
55
56
57
import path from "node:path";
import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { visualizer } from "rollup-plugin-visualizer";
import createHtmlPlugin from "vite-plugin-simple-html";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
tailwindcss(),
visualizer({
open: process.env.NODE_ENV !== "CI",
filename: "./dist/stats.html",
}),
createHtmlPlugin({
minify: true,
inject: {
data: {
mainScript: `demo/main.tsx`,
},
},
}),
],
define: {
"import.meta.env.VITE_IS_DEMO": JSON.stringify("true"),
"import.meta.env.VITE_SUPABASE_URL": JSON.stringify(
process.env.VITE_SUPABASE_URL ?? "https://demo.example.org",
),
"import.meta.env.VITE_SB_PUBLISHABLE_KEY": JSON.stringify(
process.env.VITE_SB_PUBLISHABLE_KEY ?? "https://demo.example.org",
),
},
base: "./",
esbuild: {
keepNames: true,
},
build: {
sourcemap: true,
},
server: {
proxy: {
"/api/copilotkit": {
target: "http://localhost:4000",
changeOrigin: true,
ws: true,
},
},
},
resolve: {
preserveSymlinks: true,
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});