-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
43 lines (41 loc) · 1.12 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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import Userscript from 'vite-userscript-plugin'
import { name, version } from './package.json'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const dotenv = loadEnv(mode, process.cwd(), '')
return {
build: {
outDir: dotenv.USER_SCRIPTS_DIR ?? 'dist'
},
define: {
'process.env.NODE_ENV': JSON.stringify(mode)
},
plugins: [
vue(),
Userscript({
entry: 'src/main.ts',
header: {
name,
version,
match: ['https://moneyforward.com/*'],
grant: ['GM.addStyle'],
updateURL:
'https://github.com/cormoran/power-mf-me/releases/latest/download/power-mf-me.meta.js',
downloadURL:
'https://github.com/cormoran/power-mf-me/releases/latest/download/power-mf-me.user.js'
},
server: {
port: 3000
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
}
})