This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
54 lines (53 loc) · 2.24 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
import {defineConfig} from 'vite';
import vue from '@vitejs/plugin-vue';
import monkey, {cdn, util} from 'vite-plugin-monkey';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
monkey({
entry: 'src/main.ts',
userscript: {
namespace: 'gander.dev/monkey',
homepageURL: 'https://github.com/gander/monkey-redmine-time-widget',
include: [
/\/issues\/\d+/,
],
exclude: [
/\/issues\/\d+[.\/]/,
],
},
build: {
fileName: 'monkey-redmine-time-widget.user.js',
externalGlobals: {
'vue': cdn
.jsdelivr('Vue', 'dist/vue.global.prod.js')
.concat(
await util.fn2dataUrl(() => {
// @ts-ignore
window.Vue = Vue;
}),
),
'@vueuse/core': [
'VueUse',
(version: string) => `https://cdn.jsdelivr.net/npm/@vueuse/shared@${version}/index.iife.min.js`,
(version: string) => `https://cdn.jsdelivr.net/npm/@vueuse/core@${version}/index.iife.min.js`,
await util.fn2dataUrl(() => {
// @ts-ignore
window.VueUse = VueUse;
}),
],
'pinia': [
'Pinia',
`https://cdn.jsdelivr.net/npm/vue-demi@latest/lib/index.iife.js`,
(version: string) => `https://cdn.jsdelivr.net/npm/pinia@${version}/dist/pinia.iife.js`,
],
},
externalResource: {
'primevue/resources/themes/lara-light-indigo/theme.css': 'https://cdn.jsdelivr.net/npm/[email protected]/resources/themes/lara-light-indigo/theme.css',
'primevue/resources/primevue.min.css': 'https://cdn.jsdelivr.net/npm/[email protected]/resources/primevue.min.css',
}
},
}),
],
});