-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
44 lines (43 loc) · 1.07 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import monkey, { cdn } from 'vite-plugin-monkey'
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'
import svgLoader from 'vite-svg-loader'
const { version } = require('./package.json')
export default defineConfig({
plugins: [
vue(),
monkey({
entry: 'src/main.ts',
userscript: {
icon: 'https://vitejs.dev/logo.svg',
namespace: 'npm/vite-plugin-monkey',
match: [
'https://www.wjx.cn/vj/*',
'https://www.wjx.cn/vm/*',
'https://www.wjx.cn/wjx/join/*'
],
version: version,
},
build: {
externalGlobals: {
vue: cdn.jsdelivr('Vue', 'dist/vue.global.prod.js'),
},
},
}),
svgLoader({
svgoConfig: {
multipass: true,
},
}),
],
css: {
postcss: {
plugins: [tailwindcss, autoprefixer],
},
},
define: {
'import.meta.env.VITE_APP_VERSION': JSON.stringify(version), // 使用 package.json 中的版本号
},
})