refactor(migrations): exclude all @angular/* packages from schematics bundle

This change updates the rollup configuration for the core schematics to exclude all `@angular/*` packages from the bundle. This is possible following https://github.com/angular/angular/pull/64703

This significantly reduces the size of the `@angular/core` schematics bundle, resulting in a size reduction to 5.8mb.
This commit is contained in:
Alan Agius
2025-10-28 08:16:19 +00:00
committed by Kristiyan Kostadinov
parent c57bbaa87d
commit b4e798ed87
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ const {pathPlugin} = require('../../../tools/bazel/rollup/path-plugin.cjs');
const stripBannerPlugin = {
name: 'strip-license-banner',
transform(code, _filePath) {
const banner = /(\/\**\s+\*\s@license.*?\*\/)/s.exec(code);
const banner = /(\/\*[\!\*]\s+\*\s@license.*?\*\/)/s.exec(code);
if (!banner) {
return;
}
@@ -55,7 +55,7 @@ const plugins = [
/** @type {import('rollup').RollupOptions} */
const config = {
plugins,
external: ['typescript', 'tslib', /@angular-devkit\/.+/, '@angular/compiler'],
external: ['typescript', 'tslib', /@angular-devkit\/.+/, /@angular\//],
output: {
exports: 'auto',
chunkFileNames: '[name]-[hash].cjs',
+1 -1
View File
@@ -7,7 +7,6 @@ ts_project(
deps = [
"//:node_modules/@angular-devkit/core",
"//:node_modules/@angular-devkit/schematics",
"//:node_modules/tslint",
"//packages/core/schematics/utils",
"//packages/core/schematics/utils/tsurge",
],
@@ -19,6 +18,7 @@ jasmine_test(
data = [
":test_lib",
"//:node_modules/@angular/compiler",
"//:node_modules/@angular/compiler-cli",
"//packages/core/schematics:bundles",
"//packages/core/schematics:schematics_jsons",
"//packages/core/schematics/migrations/common-to-standalone-migration:static_files",