-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
61 lines (59 loc) · 1.36 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { resolve } from 'path'
import tsconfigPaths from "vite-tsconfig-paths";
import { libInjectCss } from 'vite-plugin-lib-inject-css';
import tailwindcss from 'tailwindcss';
// https://vitejs.dev/config/
export default defineConfig({
define: {
global: [
'window',
'document'
],
'process.env.NODE_ENV': '"production"',
},
plugins: [
react({
tsDecorators: true
}),
tsconfigPaths(),
libInjectCss(),
],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: [
resolve(__dirname, 'index.ts'),
// resolve(__dirname, 'src/lib/nexai.ts')
],
name: 'nexai-chat',
// the proper extensions will be added
fileName: (type: string, name: string) => {
return `${name}.${type}.js`
},
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: [
// 'react/jsx-runtime',
'react',
'react-dom',
'mobx',
'mobx-react-lite'
]
},
},
server: {
port: Number(process.env.PORT) || 3000
},
css: {
postcss: {
plugins: [tailwindcss],
},
modules: {
localsConvention: 'camelCase' // Enable CSS Modules
}
}
})