-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
55 lines (49 loc) · 1.45 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
import { createVuePlugin } from 'vite-plugin-vue2';
import vue from '@vitejs/plugin-vue';
const isVue3 = !('USE_VUE2' in process.env);
export default {
build: {
outDir: `dist/vue${isVue3 ? '3' : '2'}`,
},
resolve: {
alias: isVue3
? {
vue: '@vue/compat',
}
: {},
},
plugins: [
isVue3
? vue({
template: {
compilerOptions: {
compatConfig: {
MODE: 3,
// required by Vue-router
CONFIG_OPTION_MERGE_STRATS: 'suppress-warning',
GLOBAL_PRIVATE_UTIL: 'suppress-warning',
GLOBAL_PROTOTYPE: 'suppress-warning',
// required due to global mixin on vue-router
INSTANCE_EVENT_HOOKS: 'suppress-warning',
OPTIONS_DESTROYED: 'suppress-warning',
INSTANCE_EVENT_EMITTER: 'suppress-warning',
// required by portal-vue
GLOBAL_SET: 'suppress-warning',
// globals
GLOBAL_EXTEND: 'suppress-warning',
GLOBAL_MOUNT: 'suppress-warning',
// functional does not work how you think ;)
COMPONENT_FUNCTIONAL: 'suppress-warning',
},
},
},
})
: createVuePlugin({
vueTemplateOptions: {
compilerOptions: {
whitespace: 'preserve',
},
},
}),
],
};