-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
29 lines (27 loc) · 1.12 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
import { dts as pluginDts } from "rollup-plugin-dts";
// Here we take all `.d.ts` files generated by `tsc` and combine them into a single one.
// Why? In order to eliminate `export` statements that are needed between multiple `.d.ts`
// file, but not needed for a final public API of this BeetPx engine.
// In other words, we want engine users to
// import { BpxRgbColor } from "@beetpx/beetpx";
// but not
// import { BpxRgbColor } from "@beetpx/beetpx/dist/color/RgbColor";
// .
const config = [
{
input: "./.dist/index.d.ts",
output: [{ file: "./dist/index.d.ts", format: "es" }],
plugins: [
pluginDts({
// Sadly, pointing to the correct tsconfig files does not prevent
// dts plugin from typechecking test files inside `src/`, while
// they should not bother it at all (because `./.dist/index.d.ts`
// is the input, and not `./src/index.ts`).
// But still, let's provide the plugin with the correct
// tsconfig and not the default one.
tsconfig: "tsconfig.compile-all-no-comments.json",
}),
],
},
];
export default config;