-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
39 lines (38 loc) · 950 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
39
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import UnoCSS from 'unocss/vite'
import * as path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
UnoCSS()
],
server: {
port: 5500,
open: true,
host: true
},
resolve: {
alias: [
{
find: /^@\//,
replacement: `${path.resolve(__dirname, 'src')}/`,
},
]
},
// NOTICE: top-level await有兼容性问题,需要插件进行编译:https://github.com/Menci/vite-plugin-top-level-await
build: {
// target: 'esnext'
rollupOptions: {
output: {
manualChunks: {
'p5-wrapper': ['@p5-wrapper/react'], // 这个包体积有点大,进行拆分
// 'react': ['react', 'react-dom'],
// 'react-router-dom': ['react-router-dom'],
// 'react-three': ['@react-three/fiber', 'three']
}
}
}
}
})