Skip to content

Commit ebb0900

Browse files
committed
fix: 🐛 place nice with commonjs
Current TS config doesn't allow one to use normal ESM imports because they don't have a default export. This config setup should allow it to play nice with modules that setup DTS files without a default exports (like a number of Hapi modules do)
1 parent aaa1676 commit ebb0900

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/modules/types.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const internals = {
1919
lib: ['lib.es2020.d.ts'],
2020
module: Ts.ModuleKind.CommonJS,
2121
target: Ts.ScriptTarget.ES2020,
22-
moduleResolution: Ts.ModuleResolutionKind.NodeJs
22+
moduleResolution: Ts.ModuleResolutionKind.NodeJs,
23+
allowSyntheticDefaultImports: true
2324
},
2425

2526
// Codes from https://github.com/microsoft/TypeScript/blob/master/src/compiler/diagnosticMessages.json

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hapi/lab",
33
"description": "Test utility",
4-
"version": "25.2.0",
4+
"version": "25.2.1",
55
"repository": "git://github.com/hapijs/lab",
66
"main": "lib/index.js",
77
"types": "lib/index.d.ts",

0 commit comments

Comments
 (0)