fix(@schematics/angular): keep deployUrl option when migrating to application builder

The `deployUrl` option is now supported with the new build system
when using the `application` builder. The migration schematic
no longer needs to remove the option if present.
This commit is contained in:
Charles Lyding 2024-04-23 09:34:39 -04:00 committed by Charles
parent 0b03829bce
commit 23cc337aa3

View File

@ -32,11 +32,6 @@ function* updateBuildTarget(
buildTarget.builder = Builders.Application;
for (const [, options] of allTargetOptions(buildTarget, false)) {
// Show warnings for using no longer supported options
if (usesNoLongerSupportedOptions(options, context, projectName)) {
continue;
}
if (options['index'] === '') {
options['index'] = false;
}
@ -82,7 +77,6 @@ function* updateBuildTarget(
}
// Delete removed options
delete options['deployUrl'];
delete options['vendorChunk'];
delete options['commonChunk'];
delete options['resourcesOutputPath'];
@ -347,19 +341,3 @@ export default function (): Rule {
}),
]);
}
function usesNoLongerSupportedOptions(
{ deployUrl }: Record<string, unknown>,
context: SchematicContext,
projectName: string,
): boolean {
let hasUsage = false;
if (typeof deployUrl === 'string') {
hasUsage = true;
context.logger.warn(
`Skipping migration for project "${projectName}". "deployUrl" option is not available in the application builder.`,
);
}
return hasUsage;
}