-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvite.config.ts
37 lines (33 loc) · 884 Bytes
/
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
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import { version } from './package.json';
const TRANSMISSION_RPC = process.env.TRANSMISSION_RPC || 'http://192.168.1.3:9091/transmission/rpc';
export default defineConfig(({ mode }) => {
return {
root: 'src',
publicDir: '../public/',
build: {
outDir: '../dist',
rollupOptions: {
input: {
main: fileURLToPath(new URL('./src/index.html', import.meta.url)),
mobile: fileURLToPath(new URL('./src/index.mobile.html', import.meta.url)),
},
},
sourcemap: true,
},
server: {
proxy: {
'/rpc': {
target: TRANSMISSION_RPC,
changeOrigin: true,
},
},
},
plugins: [],
css: {},
define: {
'import.meta.env.__APP_VERSION__': JSON.stringify(version),
},
};
});