-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.web.config.ts
43 lines (42 loc) · 1.36 KB
/
vite.web.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
/**
* SPDX-License-Identifier: Apache-2.0
* Copyright 2024 - 2025 Waldiez & contributors
*/
import react from "@vitejs/plugin-react";
import "dotenv/config";
import { resolve } from "path";
import { defineConfig } from "vite";
/* additional config for building a static site (and not a library) */
// https://vitejs.dev/config/
export default defineConfig(({ command }) => {
const base = process.env["BASE_URL"] || "./";
const publicDir =
command === "build" ? resolve(__dirname, "public", "logo") : resolve(__dirname, "public");
return {
publicDir,
base,
build: {
emptyOutDir: true,
minify: "terser",
outDir: resolve(__dirname, "out", "static"),
rollupOptions: {
output: {
manualChunks: {
react: ["react"],
"react-dom": ["react-dom"],
"xyflow-react": ["@xyflow/react"],
"react-select": ["react-select"],
"monaco-editor": ["@monaco-editor/react"],
"react-icons": ["react-icons"],
},
},
},
},
resolve: {
alias: {
"@waldiez": resolve(__dirname, "src", "waldiez"),
},
},
plugins: [react()],
};
});