diff --git a/packages/angular/build/src/builders/extract-i18n/builder.ts b/packages/angular/build/src/builders/extract-i18n/builder.ts index ab4397c5d505..a63c469f0c4c 100644 --- a/packages/angular/build/src/builders/extract-i18n/builder.ts +++ b/packages/angular/build/src/builders/extract-i18n/builder.ts @@ -32,6 +32,17 @@ export async function execute( return { success: false }; } + const { projectType } = (await context.getProjectMetadata(projectName)) as { + projectType?: string; + }; + if (projectType !== 'application') { + context.logger.error( + `The 'extract-i18n' builder requires the project type to be an applivation .`, + ); + + return { success: false }; + } + // Check Angular version. assertCompatibleAngularVersion(context.workspaceRoot); diff --git a/packages/angular_devkit/build_angular/src/builders/extract-i18n/builder.ts b/packages/angular_devkit/build_angular/src/builders/extract-i18n/builder.ts index 81edd08febf0..b744cec32ee1 100644 --- a/packages/angular_devkit/build_angular/src/builders/extract-i18n/builder.ts +++ b/packages/angular_devkit/build_angular/src/builders/extract-i18n/builder.ts @@ -35,6 +35,17 @@ export async function execute( return { success: false }; } + const { projectType } = (await context.getProjectMetadata(projectName)) as { + projectType?: string; + }; + if (projectType !== 'application') { + context.logger.error( + `The 'extract-i18n' builder requires the project type to be an applivation .`, + ); + + return { success: false }; + } + // Check Angular version. assertCompatibleAngularVersion(context.workspaceRoot);