From ccc7bae43166c3911d81901f1fe7b17d1d14af57 Mon Sep 17 00:00:00 2001 From: Matthew Bell <33056264+matthew2564@users.noreply.github.com> Date: Tue, 25 Aug 2026 08:38:01 +0100 Subject: [PATCH] feat: service bundler remove chunking --- packages/service-bundler/README.md | 5 +++++ packages/service-bundler/src/index.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/packages/service-bundler/README.md b/packages/service-bundler/README.md index 7bb9bc79..c7c0a080 100644 --- a/packages/service-bundler/README.md +++ b/packages/service-bundler/README.md @@ -2,6 +2,11 @@ Centralised script for bundling and zipping service artifacts for deployment. +JavaScript is emitted as a single entry bundle per function and API proxy. This +keeps Lambda artifacts self-contained and avoids runtime JavaScript chunk loading. +Native `.node` assets, source maps, and files supplied through `copyFiles` are +still emitted separately when required. + ### Pre-requisites - Node.js (Please see `.nvmrc` for specific version) diff --git a/packages/service-bundler/src/index.ts b/packages/service-bundler/src/index.ts index 36397272..3ff7626b 100644 --- a/packages/service-bundler/src/index.ts +++ b/packages/service-bundler/src/index.ts @@ -97,6 +97,11 @@ export class ServicePackager { mode: 'production', optimization: { minimize: true, + // Lambda handlers are deployed and loaded as self-contained artifacts. + // Keep the JavaScript graph in the entry chunk so the zip does not need + // Rspack's runtime chunk loader to resolve additional JS files. + splitChunks: false, + runtimeChunk: false, }, ignoreWarnings: [ { @@ -108,6 +113,7 @@ export class ServicePackager { externals: ['@babel/core', /^@babel\//], output: { module: true, + asyncChunks: false, }, module: { rules: [