Skip to content

Commit 67cb0fc

Browse files
committed
Use plugin to merge .d.mts.
1 parent 5eb1521 commit 67cb0fc

File tree

4 files changed

+70
-27
lines changed

4 files changed

+70
-27
lines changed

package-lock.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
"browser": "dist/tsds.mjs",
1515
"types": "dist/tsds.d.mts",
1616
"files": [
17-
"dist/ds.mjs",
18-
"dist/ds.d.mts",
19-
"dist/ds.mjs.map",
17+
"dist/tsds.d.mts",
2018
"dist/ds.wasm",
2119
"dist/ds.wasm.map",
2220
"dist/tsds.mjs",
23-
"dist/tsds.d.mts",
2421
"dist/tsds.mjs.map"
2522
],
2623
"scripts": {
@@ -40,6 +37,7 @@
4037
"jest": "^30.2.0",
4138
"npm-run-all": "^4.1.5",
4239
"rollup": "^4.53.3",
40+
"rollup-plugin-dts": "^6.3.0",
4341
"ts-jest": "^29.4.5",
4442
"ts-node": "^10.9.2",
4543
"tslib": "^2.8.1",

rollup.config.mjs

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,39 @@ import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
33
import nodeResolve from "@rollup/plugin-node-resolve";
44
import { copy } from "@web/rollup-plugin-copy";
5+
import { dts } from "rollup-plugin-dts";
56

6-
export default {
7-
input: {
8-
ds: "atsds/ds.mjs",
9-
tsds: "atsds/tsds.mts",
10-
example: "examples/main.mjs",
7+
export default [
8+
{
9+
input: {
10+
tsds: "atsds/tsds.mts",
11+
example: "examples/main.mjs",
12+
},
13+
output: {
14+
dir: "dist",
15+
format: "es",
16+
sourcemap: true,
17+
entryFileNames: "[name].mjs",
18+
},
19+
plugins: [
20+
terser(),
21+
typescript(),
22+
nodeResolve(),
23+
copy({
24+
patterns: ["ds.wasm", "ds.wasm.map"],
25+
rootDir: "atsds",
26+
}),
27+
],
1128
},
12-
output: {
13-
dir: "dist",
14-
format: "es",
15-
sourcemap: true,
16-
entryFileNames: "[name].mjs",
29+
{
30+
input: {
31+
tsds: "atsds/tsds.mts",
32+
},
33+
output: {
34+
dir: "dist",
35+
format: "es",
36+
entryFileNames: "[name].d.mts",
37+
},
38+
plugins: [dts()],
1739
},
18-
plugins: [
19-
terser(),
20-
typescript(),
21-
nodeResolve(),
22-
copy({
23-
patterns: ["ds.wasm", "ds.wasm.map", "ds.d.mts"],
24-
rootDir: "atsds",
25-
}),
26-
],
27-
};
40+
];

tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"strict": true,
66
"esModuleInterop": true,
77
"isolatedModules": true,
8-
"skipLibCheck": true,
9-
"declaration": true,
10-
"outDir": "dist"
8+
"skipLibCheck": true
119
},
1210
"include": ["atsds/*"]
1311
}

0 commit comments

Comments
 (0)