-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.ts
56 lines (53 loc) · 1.09 KB
/
rollup.config.ts
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
import dts from "rollup-plugin-dts";
import esbuild from "rollup-plugin-esbuild";
import { string } from "rollup-plugin-string";
const tsToJsEntrypoints = [
"faust",
"touch-start",
"convert",
"audio-source",
"play",
"iframe/run-in-iframe-inner.stringify",
"iframe/offline-render-inner.stringify",
"iframe/offline-render-dsp-inner.stringify",
"run-in-iframe",
"offline-render",
"offline-render-dsp",
];
export default tsToJsEntrypoints.flatMap((name) => {
const common = {
input: `src/${name}.ts`,
external: (id) => !/^[./]/.test(id),
};
return [
{
plugins: [
esbuild(),
string({
include: `**/*.stringify.js`,
}),
],
output: [
{
file: `dist/${name}.js`,
format: "cjs",
sourcemap: true,
},
{
file: `dist/${name}.mjs`,
format: "es",
sourcemap: true,
},
],
...common,
},
{
plugins: [dts()],
output: {
file: `dist/${name}.d.ts`,
format: "es",
},
...common,
},
];
});