-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
80 lines (78 loc) · 1.97 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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import VueDevTools from 'vite-plugin-vue-devtools'
import { VitePWA } from 'vite-plugin-pwa'
//import * as fs from 'node:fs'
//import * as path from 'node:path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
VueDevTools(),
VitePWA({
registerType: 'autoUpdate',
injectRegister: 'auto',
manifestFilename: 'manifest.json',
strategies: 'injectManifest',
srcDir: 'src',
filename: 'service-worker.ts',
workbox:{
sourcemap: true,
cleanupOutdatedCaches: true,
},
manifest: {
name: 'Expoll',
short_name: 'Expoll',
theme_color: '#2c3e50',
background_color: '#2c3e50',
start_url: '/#/polls?version=' + process.env.VUE_APP_VERSION,
icons: [],
shortcuts: [
{
name: 'Poll list',
short_name: 'Polls',
description: 'List of all polls',
url: '/#/polls'
},
{
name: 'User info',
short_name: 'User',
description: 'User info',
url: '/#/account'
}
]
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
proxy: {
'^/api': {
target: 'http://localhost:6060',
changeOrigin: true,
ws: true,
secure: false,
rewrite: (path) => path.replace(/^\/api/, '')
},
'^/swagger': {
target: 'http://localhost:6060',
changeOrigin: true,
ws: true,
secure: false,
}
},
host: '0.0.0.0',
/*https: {
cert: fs.readFileSync(path.resolve(__dirname, "local/certificate.pem")),
key: fs.readFileSync(path.resolve(__dirname, "local/privateKey.pem"))
},*/
port: 8080
}
})