Skip to content

Commit a493212

Browse files
authored
Fix TypeScript import to handle default export (#5604)
1 parent b916eea commit a493212

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ async function requireHelperFromModule(helperName, config, HelperClass) {
459459
if (ext === '.ts') {
460460
try {
461461
// Use the TypeScript transpilation utility
462-
const typescript = await import('typescript')
462+
const typescript = ((await import('typescript')).default || (await import('typescript')))
463463
const { tempFile, allTempFiles, fileMapping: mapping } = await transpileTypeScript(importPath, typescript)
464464

465465
debug(`Transpiled TypeScript helper: ${importPath} -> ${tempFile}`)
@@ -875,7 +875,7 @@ async function loadSupportObject(modulePath, supportObjectName) {
875875
if (ext === '.ts') {
876876
try {
877877
// Use the TypeScript transpilation utility
878-
const typescript = await import('typescript')
878+
const typescript = ((await import('typescript')).default || (await import('typescript')))
879879
const { tempFile, allTempFiles, fileMapping: mapping } = await transpileTypeScript(importPath, typescript)
880880

881881
debug(`Transpiled TypeScript file: ${importPath} -> ${tempFile}`)

0 commit comments

Comments
 (0)