Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions goldens/public-api/angular_devkit/build_angular/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export interface ServerBuilderOptions {
statsJson?: boolean;
stylePreprocessorOptions?: StylePreprocessorOptions_3;
tsConfig: string;
vendorChunk?: boolean;
verbose?: boolean;
watch?: boolean;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
},
"vendorChunk": {
"type": "boolean",
"description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.",
"description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
"default": false
},
"commonChunk": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
},
"vendorChunk": {
"type": "boolean",
"description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.",
"description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
"default": false
},
"commonChunk": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
"description": "URL where files will be deployed.",
"x-deprecated": "Use \"baseHref\" browser builder option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
},
"vendorChunk": {
"type": "boolean",
"description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
"default": false
},
"verbose": {
"type": "boolean",
"description": "Adds more details to output logging.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ export default function (): Rule {
continue;
}

for (const [, options] of allTargetOptions(target)) {
for (const [name, options] of allTargetOptions(target)) {
delete options.bundleDependencies;

if (name === 'development') {
options.vendorChunk ??= true;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function createWorkSpaceConfig(tree: UnitTestTree) {
bundleDependencies: true,
aot: true,
},
development: {
bundleDependencies: true,
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any,
},
Expand Down Expand Up @@ -83,4 +86,14 @@ describe(`Migration to update 'angular.json'. ${schematicName}`, () => {
expect(configurations?.one.bundleDependencies).toBeUndefined();
expect(configurations?.two.bundleDependencies).toBeUndefined();
});

it(`should add 'vendorChunk: true' to development configuration`, async () => {
const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise();
const { options, configurations } = getServerTarget(newTree);

expect(options.bundleDependencies).toBeUndefined();
expect(configurations).toBeDefined();
expect(configurations?.development.vendorChunk).toBeTrue();
expect(configurations?.one.vendorChunk).toBeUndefined();
});
});
1 change: 1 addition & 0 deletions packages/schematics/angular/universal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function updateConfigFile(options: UniversalOptions, tsConfigDirectory: Path): R
preserveSymlinks: options?.preserveSymlinks,
extractLicenses: options?.extractLicenses,
inlineStyleLanguage: options?.inlineStyleLanguage,
vendorChunk: options?.vendorChunk,
};
};

Expand Down