-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.config.mjs
57 lines (53 loc) · 1.25 KB
/
vite.config.mjs
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
import { classicEmberSupport, ember, extensions } from "@embroider/vite";
import { babel } from "@rollup/plugin-babel";
import { defineConfig } from "vite";
export default defineConfig(({ mode }) => {
let isProduction = mode === "production";
console.debug(`
mode: ${mode}
isProduction: ${isProduction}
NODE_ENV: ${process.env.NODE_ENV}
`);
return {
plugins: [
classicEmberSupport(),
ember(),
// extra plugins here
babel({
babelHelpers: "runtime",
extensions,
}),
],
build: {
target: "esnext",
minify: isProduction ? "terser" : false,
terserOptions: {
module: true,
toplevel: false,
ecma: 2022,
output: {
comments: false,
},
compress: {
ecma: 2022,
module: true,
passes: 6,
sequences: 30,
arguments: false,
keep_fargs: false,
toplevel: false,
unsafe: true,
hoist_funs: true,
conditionals: true,
drop_debugger: true,
evaluate: true,
reduce_vars: true,
side_effects: true,
dead_code: true,
defaults: true,
unused: true,
},
},
},
};
});