Skip to content

Commit b890921

Browse files
authored
Support TypeScript Node16/NodeNext module resolution (#6616)
1 parent e1070b5 commit b890921

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

MIGRATING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ Event order and content have changed in some places. See **Breaking Changes** be
9292
### TypeScript
9393

9494
v0.x types are not compatible with v1.x. Type definitions are now exported with the build and npm package in
95-
`dist/hls.js.d.ts`. Please use these type definitions if you are having trouble with
95+
`dist/hls.d.ts` and `dist/hls.d.mts`. Please use these type definitions if you are having trouble with
9696
[DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) `@types/hls.js` and v1.x.

api-extractor.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"dtsRollup": {
1818
"enabled": true,
19-
"untrimmedFilePath": "<projectFolder>/dist/hls.js.d.ts"
19+
"untrimmedFilePath": "<projectFolder>/dist/hls.d.ts"
2020
},
2121
"tsdocMetadata": {
2222
"enabled": false

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
},
1414
"main": "./dist/hls.js",
1515
"module": "./dist/hls.mjs",
16-
"types": "./dist/hls.js.d.ts",
16+
"types": "./dist/hls.d.ts",
1717
"exports": {
1818
".": {
19-
"types": "./dist/hls.js.d.ts",
2019
"import": "./dist/hls.mjs",
2120
"require": "./dist/hls.js"
2221
},
@@ -32,10 +31,11 @@
3231
},
3332
"scripts": {
3433
"build": "rollup --config && npm run build:types",
35-
"build:ci": "rollup --config && tsc --build tsconfig-lib.json && api-extractor run && es-check",
34+
"build:ci": "rollup --config && tsc --build tsconfig-lib.json && api-extractor run && npm run build:copy-types && es-check",
3635
"build:debug": "rollup --config --configType full --configType demo",
3736
"build:watch": "rollup --config --configType full --configType demo --watch",
38-
"build:types": "tsc --build tsconfig-lib.json && api-extractor run --local",
37+
"build:types": "tsc --build tsconfig-lib.json && api-extractor run --local && npm run build:copy-types",
38+
"build:copy-types": "cp ./dist/hls.d.ts ./dist/hls.d.mts && cp ./dist/hls.d.ts ./dist/hls.js.d.ts",
3939
"dev": "run-p build:watch serve",
4040
"serve": "http-server -o /demo .",
4141
"docs": "doctoc ./docs/API.md && api-documenter markdown -i api-extractor -o api-extractor/api-documenter && rm api-extractor/api-documenter/index.md && npm run docs-md-to-html",

0 commit comments

Comments
 (0)