-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
55 lines (51 loc) · 1.13 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
import { babel } from "@rollup/plugin-babel";
import terser from "@rollup/plugin-terser";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import license from "rollup-plugin-license";
const modules = [
"array",
"assert",
"BiMap",
"compress",
"constants",
"error",
"FRDY",
"function",
"guard",
"index",
"iterable",
"number",
"object",
"regexp",
"string",
"set",
"SortedArray",
"sorting",
"TrieMap",
// "types", <- TypeScript builds the d.ts file for this
"UnsafeMap",
];
const extensions = [".ts", ".js"];
const banner = {
content:
"Shed | Copyright (C) 2024 Peter Kröner | [email protected] | MIT",
commentStyle: "ignored",
};
export default modules.map((module) => ({
input: `./src/${module}.ts`,
plugins: [
nodeResolve({ extensions }),
babel({
extensions,
babelHelpers: "runtime",
exclude: "node_modules/**",
presets: ["@babel/preset-env", "@babel/preset-typescript"],
plugins: ["@babel/plugin-transform-runtime"],
}),
],
output: {
file: `dist/${module}.js`,
format: "esm",
plugins: [terser(), license({ banner })],
},
}));