From 12dfc39add8dba50ef610a5f06778f54631a626f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Roucheray?= Date: Tue, 13 May 2025 14:33:30 +0200 Subject: [PATCH] Fix `singleBundle` option by preventing dynamic import to create chunks --- lib/src/utils/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/utils/index.ts b/lib/src/utils/index.ts index 32afa08..dd1d8ea 100644 --- a/lib/src/utils/index.ts +++ b/lib/src/utils/index.ts @@ -56,6 +56,8 @@ function setupConfigHook(transforms: Transforms, options: any, context: BuilderC transforms[configTransformerName] = (config: webpack.Configuration) => { if (options.singleBundle) { + config.output = {...config.output, asyncChunks: false }; + if (!options.keepPolyfills && config.entry && config.entry['polyfills']) { delete config.entry['polyfills']; } @@ -70,7 +72,7 @@ function setupConfigHook(transforms: Transforms, options: any, context: BuilderC const keepStyles = !options.bundleStyles || options.keepStyles; - if (options.singleBundle && ! keepStyles && config.entry && config.entry['styles']) { + if (options.singleBundle && !keepStyles && config.entry && config.entry['styles']) { delete config.entry['styles']; }