-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
34 lines (33 loc) · 922 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
import { resolve } from 'path'
import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import UnoCSS from 'unocss/vite'
export default defineConfig({
server: {
host: '0.0.0.0',
port: 5173
},
plugins: [UnoCSS()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
minify: true, // 开启代码压缩
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
detail: resolve(__dirname, 'pages', 'detail.html'),
rank: resolve(__dirname, 'pages', 'rank.html'),
play: resolve(__dirname, 'pages', 'play.html'),
board: resolve(__dirname, 'pages', 'board.html')
},
output: {
chunkFileNames: 'static/js/[name]-[hash].js',
entryFileNames: 'static/js/[name]-[hash].js',
assetFileNames: 'static/[ext]/[name]-[hash].[ext]'
}
}
}
})