Skip to content

Commit d7d0354

Browse files
committed
refactor(@angular/build): refine rolldown advanced chunking strategy
Updates the experimental `advancedChunks` configuration for Rolldown to improve chunking behavior and web performance. This change introduces a `maxSize` of 512 KB and a named `group` to the configuration. The `maxSize` helps prevent overly large JavaScript bundles that can harm load performance by blocking the main thread.
1 parent 6639085 commit d7d0354

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/angular/build/src/builders/application/chunk-optimizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export async function optimizeChunks(
253253

254254
const result = await bundle.generate({
255255
minify: { mangle: false, compress: false },
256-
advancedChunks: { minSize: 8192 },
256+
advancedChunks: { groups: [{ name: 'chunks' }], minSize: 8 * 1024, maxSize: 512 * 1024 },
257257
sourcemap,
258258
chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`,
259259
});

0 commit comments

Comments
 (0)