Skip to content

Commit

Permalink
fix: use correct file extensions for transpilation
Browse files Browse the repository at this point in the history
  • Loading branch information
estephinson committed Dec 7, 2023
1 parent 2626541 commit 550949f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/functions/netlify-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class NetlifyFunction {
}

if (extension === '.js') {
return '.js'
return '.mjs'
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/functions/runtimes/js/builders/zisi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default async function handler({ config, directory, errorExit, func, meta
featureFlags.zisi_pure_esm_mjs = true
} else {
// We must use esbuild for certain file extensions.
const mustTranspile = ['.js', '.ts', '.mts', '.cts'].includes(path.extname(func.mainFile))
const mustTranspile = ['.mjs', '.ts', '.mts', '.cts'].includes(path.extname(func.mainFile))
const mustUseEsbuild = hasTypeModule || mustTranspile

if (mustUseEsbuild && !functionsConfig['*'].nodeBundler) {
Expand Down

0 comments on commit 550949f

Please sign in to comment.