Skip to content

Commit 7751f9c

Browse files
Bundle d.ts files with rollup-plugin-dts
1 parent cc33575 commit 7751f9c

File tree

4 files changed

+103
-15
lines changed

4 files changed

+103
-15
lines changed

Diff for: Runtime/rollup.config.mjs

+24-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
import typescript from "@rollup/plugin-typescript";
2+
import dts from "rollup-plugin-dts";
23

34
/** @type {import('rollup').RollupOptions} */
4-
const config = {
5-
input: "src/index.ts",
6-
output: [
7-
{
8-
file: "lib/index.mjs",
5+
const config = [
6+
{
7+
input: "src/index.ts",
8+
output: [
9+
{
10+
file: "lib/index.mjs",
11+
format: "esm",
12+
},
13+
{
14+
file: "lib/index.js",
15+
format: "umd",
16+
name: "JavaScriptKit",
17+
},
18+
],
19+
plugins: [typescript()],
20+
},
21+
{
22+
input: "src/index.ts",
23+
output: {
24+
file: "lib/index.d.ts",
925
format: "esm",
1026
},
11-
{
12-
dir: "lib",
13-
format: "umd",
14-
name: "JavaScriptKit",
15-
},
16-
],
17-
plugins: [typescript()],
18-
};
27+
plugins: [dts()],
28+
},
29+
];
1930

2031
export default config;

Diff for: Runtime/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"compilerOptions": {
3-
"declaration": true,
4-
"declarationDir": "lib",
3+
"declaration": false,
54
"importHelpers": true,
65
"module": "esnext",
76
"noEmit": true,

Diff for: package-lock.json

+77
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"playwright": "^1.51.0",
3939
"prettier": "3.5.3",
4040
"rollup": "^4.37.0",
41+
"rollup-plugin-dts": "^6.2.1",
4142
"typescript": "^5.8.2"
4243
}
4344
}

0 commit comments

Comments
 (0)