-
Notifications
You must be signed in to change notification settings - Fork 94
/
vite.config.ts
93 lines (92 loc) · 6.1 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import monkey, { cdn, util } from 'vite-plugin-monkey'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
monkey({
entry: 'src/main.ts',
userscript: {
name: {
'': 'Bilibili Live Tasks Helper',
en: 'Bilibili Live Tasks Helper',
zh: 'Bilibili Live Tasks Helper'
},
namespace: 'https://github.com/andywang425',
author: 'andywang425',
description: {
'': 'Enhancing the experience of watching Bilibili live streaming.',
en: 'Enhancing the experience of watching Bilibili live streaming.',
zh: '增强Bilibili直播观看体验。'
},
homepageURL: 'https://github.com/andywang425/BLTH',
supportURL: 'https://github.com/andywang425/BLTH/issues',
updateURL:
'https://raw.githubusercontent.com/andywang425/BLTH/master/dist/bilibili-live-tasks-helper.meta.js',
downloadURL:
'https://raw.githubusercontent.com/andywang425/BLTH/master/dist/bilibili-live-tasks-helper.min.user.js',
icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDEuMDY1IiBoZWlnaHQ9IjEyNy43NDciIHZpZXdCb3g9IjAgMCAzNy4zMjQgMzMuOCI+PHBhdGggZmlsbD0iIzIwYjBlMyIgZD0iTTg2Ljk2MiAxMTIuMzMyYTIuNjYxIDIuNjYxIDAgMCAxIDIuMjYyIDAgNS41MzYgNS41MzYgMCAwIDEgMS4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40MTctLjY4LS45NTYtLjcyLTEuNTkyLS4wNC0uNjU0LjUzNS0xLjI0Ljc5NC0xLjQ5OC45Mi0uOTE0IDEuNzQzLTEuOTY4IDIuNTUtMi44MTIgMS41NzUtMS44IDQuMTIuNDI4IDIuNTQ2IDIuMjI3eiIgc3R5bGU9ImZpbGw6IzIwYjBlMztmaWxsLW9wYWNpdHk6MTtzdHJva2Utd2lkdGg6LjUyNDE1OTtzdHJva2UtZGFzaGFycmF5Om5vbmUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC03OS4xOTMgLTExMi4wOCkiLz48L3N2Zz4NCg==',
copyright: '2024, andywang425 (https://github.com/andywang425)',
license: 'MIT',
match: [
'*://live.bilibili.com/1*',
'*://live.bilibili.com/2*',
'*://live.bilibili.com/3*',
'*://live.bilibili.com/4*',
'*://live.bilibili.com/5*',
'*://live.bilibili.com/6*',
'*://live.bilibili.com/7*',
'*://live.bilibili.com/8*',
'*://live.bilibili.com/9*',
'*://live.bilibili.com/blanc/1*',
'*://live.bilibili.com/blanc/2*',
'*://live.bilibili.com/blanc/3*',
'*://live.bilibili.com/blanc/4*',
'*://live.bilibili.com/blanc/5*',
'*://live.bilibili.com/blanc/6*',
'*://live.bilibili.com/blanc/7*',
'*://live.bilibili.com/blanc/8*',
'*://live.bilibili.com/blanc/9*'
],
'run-at': 'document-start',
connect: [
'api.bilibili.com',
'api.live.bilibili.com',
'api.vc.bilibili.com',
'passport.bilibili.com',
'live.bilibili.com',
'live-trace.bilibili.com'
]
},
build: {
externalGlobals: {
vue: cdn.unpkg('Vue', 'dist/vue.global.prod.js').concat(
// For pinia, another solution is .concat('https://unpkg.com/vue-demi@latest/lib/index.iife.js')
util.dataUrl(';window.Vue=Vue;window.VueDemi=Vue;')
),
'element-plus': cdn.unpkg('ElementPlus', 'dist/index.full.min.js'),
'@element-plus/icons-vue': cdn.unpkg('ElementPlusIconsVue', 'dist/index.iife.min.js'),
pinia: cdn.unpkg('Pinia', 'dist/pinia.iife.prod.js'),
'vue-draggable-plus': cdn.unpkg('VueDraggablePlus', 'dist/vue-draggable-plus.iife.js'),
lodash: cdn.unpkg('_', 'lodash.min.js'),
'hotkeys-js': cdn.unpkg('hotkeys', 'dist/hotkeys.min.js'),
luxon: cdn.unpkg('luxon', 'build/global/luxon.min.js'),
'crypto-js': cdn.unpkg('CryptoJS', 'crypto-js.js')
},
externalResource: {
'element-plus/dist/index.css': cdn.unpkg()
},
metaFileName: true
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})