-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
82 lines (75 loc) · 2.45 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
81
82
//----------------------------------------------------------------------------------------------------------------------
// Vite Config
//----------------------------------------------------------------------------------------------------------------------
import { defineConfig } from 'vite';
// Vite Plugins
import vue from '@vitejs/plugin-vue2';
// Config
import config from './src/config';
import { version } from './package.json';
//----------------------------------------------------------------------------------------------------------------------
/** @type {import('vite').UserConfig} */
export default defineConfig({
root: 'src/client',
publicDir: 'assets',
plugins: [
vue()
],
// Remove charset warning caused by bootstrap
css: {
postcss: {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) =>
{
if(atRule.name === 'charset')
{
atRule.remove();
}
}
}
}
]
}
},
server: {
port: config.http.port + 1,
proxy: {
'/auth': `http://localhost:${ config.http.port }`,
'/api': `http://localhost:${ config.http.port }`,
'/socket.io': {
target: `http://localhost:${ config.http.port }`,
ws: true
}
},
https: false,
open: false
},
resolve: {
alias: {
'vue': 'vue/dist/vue.esm.js',
'@vue-bootstrap-components/vue-bootstrap-autocomplete':
'@vue-bootstrap-components/vue-bootstrap-autocomplete/dist/VueBootstrapAutocomplete.umd.min.js'
}
},
define: {
APP_VERSION: `"${ version }"`
},
build: {
outDir: '../../dist/src/client',
emptyOutDir: true,
cssCodeSplit: true,
chunkSizeWarningLimit: 650,
rollupOptions: {
output: {
manualChunks: {
bootstrap: [ 'popper.js', 'jquery', 'bootstrap' ],
bootstrapVue: [ 'bootstrap-vue' ]
}
}
}
}
});
//----------------------------------------------------------------------------------------------------------------------