Skip to content

Commit 4779fe3

Browse files
committed
refactor(@angular/build): switch back to rollup for chunk optimizer
Rollup currently appears to be more effective at optimizing total output chunk count. While this is investigated further, the experimental chunk optimizer will be switched back to using rollup.
1 parent c14ebe7 commit 4779fe3

File tree

5 files changed

+260
-235
lines changed

5 files changed

+260
-235
lines changed

packages/angular/build/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ ts_project(
111111
":node_modules/picomatch",
112112
":node_modules/piscina",
113113
":node_modules/postcss",
114-
":node_modules/rolldown",
114+
":node_modules/rollup",
115115
":node_modules/sass",
116116
":node_modules/source-map-support",
117117
":node_modules/tinyglobby",

packages/angular/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"parse5-html-rewriting-stream": "8.0.0",
3838
"picomatch": "4.0.3",
3939
"piscina": "5.1.3",
40-
"rolldown": "1.0.0-beta.38",
40+
"rollup": "4.52.3",
4141
"sass": "1.90.0",
4242
"semver": "7.7.2",
4343
"source-map-support": "0.5.21",

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import type { Message, Metafile } from 'esbuild';
2121
import assert from 'node:assert';
22-
import { type OutputAsset, type OutputChunk, rolldown } from 'rolldown';
22+
import { type OutputAsset, type OutputChunk, rollup } from 'rollup';
2323
import {
2424
BuildOutputFile,
2525
BuildOutputFileType,
@@ -216,7 +216,7 @@ export async function optimizeChunks(
216216
let bundle;
217217
let optimizedOutput;
218218
try {
219-
bundle = await rolldown({
219+
bundle = await rollup({
220220
input: mainFile,
221221
plugins: [
222222
{
@@ -252,8 +252,7 @@ export async function optimizeChunks(
252252
});
253253

254254
const result = await bundle.generate({
255-
minify: { mangle: false, compress: false },
256-
advancedChunks: { minSize: 8192 },
255+
compact: true,
257256
sourcemap,
258257
chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`,
259258
});

0 commit comments

Comments
 (0)