-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
57 lines (54 loc) · 1.32 KB
/
vite.config.js
File metadata and controls
57 lines (54 loc) · 1.32 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 react from "@vitejs/plugin-react";
import path from "path";
import eslint from "vite-plugin-eslint2";
import { defineConfig } from "vite";
export default ({ mode }) => {
return defineConfig({
root: "src",
publicDir: mode === 'development' ? '../public' : false,
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
preview: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
build: {
lib: {
entry: path.resolve(__dirname, "src/index.tsx"),
name: "rcb-plugin",
fileName: "index",
formats: ["es", "cjs"],
},
rollupOptions: {
external: [
"react",
"react-dom",
"react-dom/server",
"react/jsx-runtime",
"react/jsx-dev-runtime",
"react-chatbotify",
"@mlc-ai/web-llm",
],
output: {
globals: {
react: "React",
}
},
},
outDir: "../dist",
assetsInclude: ['**/*.wasm'],
},
plugins: [
react({
include: "**/*.{jsx,tsx}",
}),
eslint()
],
});
}