-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
51 lines (49 loc) · 1.74 KB
/
rollup.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
import terser from "@rollup/plugin-terser";
/** @type {[string]} */
const formats = ["iife", "esm", "cjs", "umd"];
export default formats.map(function (format) {
return {
input: "src/bundle.js",
output: {
file: `dist/${format}/vif.${format === "cjs" ? "cjs" : "js"}`,
format: format,
name: (format === "iife" || format === "umd") && "Vif",
minifyInternalExports: true,
},
plugins: [
terser({
mangle: {
properties: {
reserved: [
// reserved javascript properties
"connectedCallback",
"handleEvent",
// customElement properties
"onMount",
"onUnmount",
"useRef",
"useEffect",
// Element properties
"handler",
// renderFunction params
"props",
"html",
"css",
// signal properties
"value",
// global export properties
"useDefine",
"useSignal",
"useEffect",
"useObserve",
"useNavigate",
/**/ "route",
"useI18n",
/**/ "locale",
],
},
},
}),
],
};
});