generated from lifeart/template-gxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mts
51 lines (50 loc) · 1.04 KB
/
vite.config.mts
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
import { defineConfig } from "vite";
import { compiler, stripGXTDebug } from "@lifeart/gxt/compiler";
import babel from "vite-plugin-babel";
export default defineConfig(({ mode }) => ({
plugins: [
mode === "production"
? (babel({
babelConfig: {
babelrc: false,
configFile: false,
plugins: [stripGXTDebug],
},
}) as any)
: null,
compiler(mode, {
flags: {
TRY_CATCH_ERROR_HANDLING: false,
SUPPORT_SHADOW_DOM: false,
},
}),
],
base: "",
rollupOptions: {
input: {
main: "index.html",
tests: "tests.html",
},
},
build: {
modulePreload: false,
target: "modules",
minify: "terser",
terserOptions: {
module: true,
compress: {
hoist_funs: true,
drop_console: true,
inline: 2,
passes: 5,
unsafe: true,
unsafe_symbols: true,
},
mangle: {
module: true,
toplevel: true,
properties: false,
},
},
},
}));