-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (33 loc) · 880 Bytes
/
Copy pathvite.config.ts
File metadata and controls
37 lines (33 loc) · 880 Bytes
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
import { UserConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vitePluginString from 'vite-plugin-string'
import htmlPorter from './plugins/htmlPorter'
import baiduAnalytics from './plugins/baiduAnalytics'
import { minifyHtml } from 'vite-plugin-html'
export default <UserConfig>{
esbuildTarget: 'es6',
plugins: [
vue(),
vueJsx(),
vitePluginString(),
/* 将 </title> 到 </head> 之间的内容移至 </body> 之前 */
htmlPorter([
{
range: {
start: '</title>',
end: '</head>',
},
target: '</body>',
type: 'pre',
},
]),
/* 百度统计 */
baiduAnalytics('688767575360f4fcf32801af3d9a2137'),
/* 压缩 html */
minifyHtml(),
],
optimizeDeps: {
include: ['photoswipe/dist/photoswipe-ui-default'],
},
}