Skip to content

Commit

Permalink
fix: πŸ› place nice with commonjs
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
damusix committed Jun 23, 2024
1 parent a3fe14b commit 9056b3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/modules/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const internals = {
lib: ['lib.es2020.d.ts'],
module: Ts.ModuleKind.CommonJS,
target: Ts.ScriptTarget.ES2019,
moduleResolution: Ts.ModuleResolutionKind.NodeJs
moduleResolution: Ts.ModuleResolutionKind.NodeJs,
allowSyntheticDefaultImports: true,
esModuleInterop: true
},

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

0 comments on commit 9056b3e

Please sign in to comment.