feat: support esm mode for codebase bundles (#6709)

* rawAppsS3

* make fn common

* all

* merge

* nit

* fix ingress

* all

* all

* all

* all
This commit is contained in:
Ruben Fiszel
2025-09-30 14:45:30 +00:00
committed by GitHub
parent 0ba5e3e9c7
commit d382ea7c8b
13 changed files with 352 additions and 208 deletions
+3 -2
View File
@@ -222,9 +222,10 @@ export async function handleFile(
log.info(`Started bundling ${path} ...`);
const startTime = performance.now();
const format = codebase.format ?? "cjs";
const out = await esbuild.build({
entryPoints: [path],
format: "cjs",
format: format,
bundle: true,
write: false,
external: codebase.external,
@@ -232,7 +233,7 @@ export async function handleFile(
define: codebase.define,
platform: "node",
packages: "bundle",
target: "node20.15.1",
target: format == "cjs" ? "node20.15.1" : "esnext",
});
const endTime = performance.now();
bundleContent = out.outputFiles[0].text;