Skip to content

Commit

Permalink
feat: add extensions to esm checking (#694) (#743)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Wecke <mark.wecke@gmail.com>
  • Loading branch information
mdonnalley and draconisNoctis authored Jul 25, 2023
1 parent b133109 commit 427aa5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ export default class ModuleLoader {

switch (extension) {
case '.js':
return getPackageType.sync(filePath) === 'module'

case '.jsx':
case '.ts':
case '.tsx':
return getPackageType.sync(filePath) === 'module'

case '.mjs':
case '.mts':
return true

default:
Expand Down

0 comments on commit 427aa5b

Please sign in to comment.