From 550949f9eb041a9876efb44cfad322188ec64873 Mon Sep 17 00:00:00 2001 From: Ed Stephinson Date: Thu, 7 Dec 2023 15:11:34 +0000 Subject: [PATCH] fix: use correct file extensions for transpilation --- src/lib/functions/netlify-function.ts | 2 +- src/lib/functions/runtimes/js/builders/zisi.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/functions/netlify-function.ts b/src/lib/functions/netlify-function.ts index 8acd316709c..f4f55501771 100644 --- a/src/lib/functions/netlify-function.ts +++ b/src/lib/functions/netlify-function.ts @@ -121,7 +121,7 @@ export default class NetlifyFunction { } if (extension === '.js') { - return '.js' + return '.mjs' } } diff --git a/src/lib/functions/runtimes/js/builders/zisi.ts b/src/lib/functions/runtimes/js/builders/zisi.ts index e85de6f0429..1d08ab35112 100644 --- a/src/lib/functions/runtimes/js/builders/zisi.ts +++ b/src/lib/functions/runtimes/js/builders/zisi.ts @@ -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) {