-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathvite.config.js
More file actions
36 lines (34 loc) · 854 Bytes
/
Copy pathvite.config.js
File metadata and controls
36 lines (34 loc) · 854 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
import { resolve } from 'path'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import inject from '@rollup/plugin-inject'
import { createHtmlPlugin } from 'vite-plugin-html'
// https://vitejs.dev/config/
export default defineConfig({
base: '/official-website/',
plugins: [
vue(),
inject({
$: 'jquery', // 这里会自动载入 node_modules 中的 jquery
jQuery: 'jquery',
'windows.jQuery': 'jquery',
BMap: 'BMap'
}),
createHtmlPlugin({
/**
* 需要注入 index.html ejs 模版的数据
* https://blog.csdn.net/SilenceJude/article/details/128297371
*/
inject: {
data: {
VITE_APP_VERSION: new Date().toLocaleString()
}
}
})
],
resolve: {
alias: {
'@': resolve(__dirname, './src')
}
}
})