diff --git a/packages/schematics/angular/library/index.ts b/packages/schematics/angular/library/index.ts index 68f9f8f513c4..52ca74bc65ce 100644 --- a/packages/schematics/angular/library/index.ts +++ b/packages/schematics/angular/library/index.ts @@ -181,6 +181,10 @@ export default function (options: LibraryOptions): Rule { export: true, standalone: options.standalone, project: packageName, + // Explicitly set an empty `type` since it doesn't necessarily make sense in a library. + // This also ensures that the generated files are valid even if the `component` schematic + // inherits its `type` from the workspace. + type: '', }), (_tree: Tree, context: SchematicContext) => { if (!options.skipPackageJson && !options.skipInstall) {