From 9f263816ef9564c1fe58ba484e9f371c83a6f68d Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Sat, 25 Jan 2025 16:45:40 -0600 Subject: [PATCH] fix build --- cloudformation/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cloudformation/main.yml b/cloudformation/main.yml index 7c14fb0..5edf7e3 100644 --- a/cloudformation/main.yml +++ b/cloudformation/main.yml @@ -126,13 +126,20 @@ Resources: Format: esm Minify: true OutExtension: - - .js=.js - Target: "node22" + - .js=.mjs + Target: "es2022" Sourcemap: false EntryPoints: - api/lambda.js External: - aws-sdk + Banner: + - js=import path from 'path'; + import { fileURLToPath } from 'url'; + import { createRequire as topLevelCreateRequire } from 'module'; + const require = topLevelCreateRequire(import.meta.url); + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); Properties: Architectures: [arm64] CodeUri: ../dist