diff --git a/lib/plugins/esbuild/index.js b/lib/plugins/esbuild/index.js index 9cde54556..9706287e5 100644 --- a/lib/plugins/esbuild/index.js +++ b/lib/plugins/esbuild/index.js @@ -142,7 +142,7 @@ class Esbuild { return true } - const functionName = path.extname(functionHandler).slice(1); + const functionName = path.extname(functionObject[handlerPropertyName]).slice(1); const handlerPath = functionHandler.replace(`.${functionName}`, ''); let parsedExtension = undefined; for (const extension of ['.js', '.ts', '.cjs', '.mjs', '.cts', '.mts', '.jsx', '.tsx']) {