Skip to content

Commit f338d89

Browse files
fix rollup
1 parent 7546618 commit f338d89

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"./package.json": "./package.json",
1313
".": {
1414
"import": {
15-
"types": "./types/index.d.ts",
15+
"types": "./dist/types/index.d.ts",
1616
"default": "./dist/esm/index.js"
1717
},
1818
"require": {
19-
"types": "./types/index.d.ts",
19+
"types": "./dist/types/index.d.ts",
2020
"default": "./dist/commonjs/index.js"
2121
}
2222
}
@@ -26,7 +26,7 @@
2626
"build-test": "npm run build-test-esm && npm run build-test-cjs",
2727
"build-test-esm": "tsc -p ./tsconfig.test.esm.json && cpy esm-package.json out/esm --rename=package.json",
2828
"build-test-cjs": "tsc -p ./tsconfig.test.cjs.json && cpy cjs-package.json out/commonjs --rename=package.json",
29-
"clean": "rimraf dist dist-esm out types",
29+
"clean": "rimraf dist out",
3030
"dev": "rollup --config --watch",
3131
"lint": "eslint src/ test/ examples/ --ext .js,.ts,.mjs",
3232
"fix-lint": "eslint src/ test/ examples/ --fix --ext .js,.ts,.mjs",

rollup.config.mjs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,13 @@ export default [
3131
],
3232
plugins: [
3333
typescript({
34-
compilerOptions: {
35-
"lib": [
36-
"DOM",
37-
"WebWorker",
38-
"ESNext"
39-
],
40-
"skipDefaultLibCheck": true,
41-
"module": "NodeNext",
42-
"moduleResolution": "NodeNext",
43-
"target": "ES2022",
44-
"strictNullChecks": true,
45-
"strictFunctionTypes": true,
46-
"sourceMap": true,
47-
"inlineSources": true
48-
}
34+
tsconfig: "./tsconfig.json",
4935
})
5036
],
5137
},
5238
{
5339
input: "src/index.ts",
54-
output: [{ file: "types/index.d.ts", format: "esm" }],
40+
output: [{ file: "dist/types/index.d.ts", format: "esm" }],
5541
plugins: [dts()],
5642
},
5743
];

tsconfig.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
{
22
"compilerOptions": {
3+
// Include ES2022 (modern JS), ESNext (future features), DOM and web worker APIs for browser support.
34
"lib": [
45
"DOM",
56
"WebWorker",
67
"ESNext",
78
"ES2022"
89
],
9-
"skipDefaultLibCheck": true,
10-
"moduleResolution": "Node",
10+
// Generate modern JavaScript syntax compatible with Node 18+ and modern browsers.
1111
"target": "ES2022",
12+
13+
// Use Node-style resolution to locate imports
14+
"moduleResolution": "Node",
15+
16+
// Ensure strict type-checking
1217
"strictNullChecks": true,
1318
"strictFunctionTypes": true,
19+
"skipDefaultLibCheck": true,
20+
21+
// Generate source maps and inline original TypeScript sources for debugging.
1422
"sourceMap": true,
1523
"inlineSources": true,
24+
1625
"allowSyntheticDefaultImports": true,
1726
"esModuleInterop": true
1827
},

0 commit comments

Comments
 (0)