-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.ts
114 lines (113 loc) · 4.04 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import { defineConfig } from 'vite';
import monkey, { cdn } from 'vite-plugin-monkey';
// https://vitejs.dev/config/
export default defineConfig(({ command }) => {
let downloadURL: string | undefined;
let updateURL: string | undefined;
let outDir: string | undefined;
let emptyOutDir = true;
if (command === 'build') {
downloadURL = 'https://github.com/MapoMagpie/eh-view-enhance/raw/master/eh-view-enhance.user.js';
updateURL = 'https://github.com/MapoMagpie/eh-view-enhance/raw/master/eh-view-enhance.meta.js';
outDir = '';
emptyOutDir = false;
}
return {
build: {
target: 'esnext',
outDir,
emptyOutDir,
},
server: {
host: '0.0.0.0',
},
plugins: [
monkey({
entry: 'src/main.ts',
userscript: {
version: "4.5.18",
icon: 'https://exhentai.org/favicon.ico',
namespace: 'https://github.com/MapoMagpie/eh-view-enhance',
supportURL: 'https://github.com/MapoMagpie/eh-view-enhance/issues',
downloadURL,
updateURL,
match: [
'https://exhentai.org/*',
'https://e-hentai.org/*',
"http://exhentai55ld2wyap5juskbm67czulomrouspdacjamjeloj7ugjbsad.onion/*",
'https://nhentai.net/*',
'https://steamcommunity.com/id/*/screenshots*',
'https://hitomi.la/*',
'https://*.pixiv.net/*',
'https://yande.re/*',
'https://konachan.com/*',
'https://rokuhentai.com/*',
'https://18comic.org/*',
'https://18comic.vip/*',
'https://18-comicfreedom.xyz/*',
'https://rule34.xxx/*',
'https://imhentai.xxx/*',
'https://danbooru.donmai.us/*',
'https://gelbooru.com/*',
'https://twitter.com/*',
'https://x.com/*',
'https://*.wnacg.com/*',
'https://*.hm19.lol/*',
'https://*.hm18.lol/*',
'https://*.hm17.lol/*',
'https://hentainexus.com/*',
],
name: { "": "E HENTAI VIEW ENHANCE", "zh-CN": "E绅士阅读强化" },
license: 'MIT',
author: 'MapoMagpie',
description: {
"": "Manga Viewer + Downloader, Focus on experience and low load on the site. Support: e-hentai.org | exhentai.org | pixiv.net | 18comic.vip | nhentai.net | hitomi.la | rule34.xxx | danbooru.donmai.us | gelbooru.com | twitter.com | wnacg.com",
"zh-CN": "漫画阅读 + 下载器,注重体验和对站点的负载控制。支持:e-hentai.org | exhentai.org | pixiv.net | 18comic.vip | nhentai.net | hitomi.la | rule34.xxx | danbooru.donmai.us | gelbooru.com | twitter.com | wnacg.com"
},
connect: [
'exhentai.org',
'e-hentai.org',
'hath.network',
"exhentai55ld2wyap5juskbm67czulomrouspdacjamjeloj7ugjbsad.onion",
'nhentai.net',
'hitomi.la',
'akamaihd.net',
'i.pximg.net',
'ehgt.org',
'yande.re',
'konachan.com',
'18comic.org',
'18comic.vip',
'18-comicfreedom.xyz',
'rule34.xxx',
'imhentai.xxx',
'donmai.us',
'gelbooru.com',
'twimg.com',
'qy0.ru',
'wnimg.ru',
'hentainexus.com',
'tencentcs.com',
],
grant: [
'GM_xmlhttpRequest',
'GM_setValue',
'GM_getValue',
],
},
build: {
fileName: 'eh-view-enhance.user.js',
metaFileName: 'eh-view-enhance.meta.js',
externalGlobals: {
"@zip.js/zip.js": cdn.jsdelivr("zip", "dist/zip-full.min.js"),
"file-saver": cdn.jsdelivr("saveAs", "dist/FileSaver.min.js"),
"hammerjs": cdn.jsdelivr("Hammer", "hammer.min.js"),
"pica": cdn.jsdelivr("pica", "dist/pica.min.js"),
},
autoGrant: true,
},
server: { mountGmApi: false },
}),
],
};
});