-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.js
71 lines (68 loc) · 1.76 KB
/
vite.config.js
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
import { fileURLToPath, URL } from 'node:url'
// import { resolve } from 'path'
import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
import vue2 from '@vitejs/plugin-vue2'
import vue2Jsx from '@vitejs/plugin-vue2-jsx'
import viteCompression from 'vite-plugin-compression'
import mpa from 'vite-plugin-mpa'
import svgLoader from './svg-loader'
import svgSprite from './svg-sprite'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
build: {
outDir: 'dist',
// assetsDir: 'static',
assetsDir: 'static/settings',
// rollupOptions: {
// input: {
// main: resolve(__dirname, 'user/index.html'),
// admin: resolve(__dirname, 'admin/index.html')
// }
// }
},
base: '/',
// base: mode === 'development' ? '' : '/settings',
plugins: [
vue2(),
vue2Jsx(),
// solution for this vite limitation https://github.com/vitejs/vite/issues/1911
mpa({
open: '/user/'
}),
svgSprite({
user: ['./icons/user'],
admin: ['./icons/admin']
}),
svgLoader(),
legacy({
targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
}),
viteCompression()
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
path: 'path-browserify',
https: 'agent-base'
}
},
server: {
proxy: {
"/ws": {
ws: true,
target: 'ws://localhost'
// target: 'wss://dev.gisquick.org'
},
"/api": {
target: 'http://localhost'
// target: 'https://dev.gisquick.org',
// target: 'https://portal.mapotip.cz:8443/',
// changeOrigin: true,
// secure: false,
// cookieDomainRewrite: 'localhost'
}
}
}
}))