-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
47 lines (42 loc) · 1.13 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
import { defineConfig } from 'vite'
import Userscript from 'vite-userscript-plugin'
import pkg from './package.json'
const DOMAINS = [
'spaces.ru',
'spcs.me',
'spaces.im',
'gdespaces.com',
'spac1.com',
'spac1.net',
'spaces-blogs.com',
'world76.spcs.bio'
]
export default defineConfig((config) => {
const isDev = config.mode === 'development'
const basePath = isDev ? 'http://localhost:3000/' : pkg.homepage
return {
plugins: [
Userscript({
fileName: pkg.name,
entry: 'src/index.ts',
header: {
name: 'Spaces+',
version: pkg.version,
author: `${pkg.author.name} <${pkg.author.email}> ${pkg.author.url}`,
license: pkg.license,
icon: `${basePath}icons/logo_96.png`,
require: `${basePath}libs/colorpicker.js`,
match: DOMAINS.map((domain) => `https://${domain}/*`),
updateURL: `${pkg.homepage}${pkg.name}.meta.js`,
downloadURL: `${pkg.homepage}${pkg.name}.user.js`
},
server: {
port: 3000
},
esbuildTransformOptions: {
banner: ';'
}
})
]
}
})