-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
57 lines (56 loc) · 1.3 KB
/
rollup.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 { getBabelOutputPlugin } from "@rollup/plugin-babel";
//import terser from "@rollup/plugin-terser";
import * as path from "path";
const
TMP = "tmp",
DIST = "dist",
format = "es",
ext = [path.resolve("base-element.js")],
plugins = [
getBabelOutputPlugin({
comments: false,
assumptions: {"noDocumentAll":true},
plugins: [
["babel-plugin-private-to-public", {"prefix":"ø"}], // ø
"@babel/plugin-transform-nullish-coalescing-operator",
"@babel/plugin-transform-optional-chaining"
]
})/*,
terser({
compress: {
keep_classnames:true,
keep_infinity:true,
module:true
},
mangle: {
keep_classnames:true,
module:true,
toplevel:true,
properties: {
regex: /^ø/
}
}
})*/
],
files = [
["base-element", TMP,],
["multi-check", TMP, ext],
["state-btn", TMP, ext],
["input-num", TMP, ext],
["elements", TMP,],
["apps/common", DIST,],
["apps/multi-state/index", DIST,],
["apps/input-num/index", DIST, ext]
];
//==============================================
// Map files to an array of objects
export default files.map(([name, dir, external]) => {
return {
input: `${name}.js`,
output: {
file: `${dir}/${name}.js`,
format
},
plugins, external
};
});