Skip to content

Commit e9ae950

Browse files
MeAkibalan-agius4
authored andcommitted
fix(@schematics/angular): set explicit type for the app-shell component
`ng generate app-shell` adds an `AppShell` import from `./app-shell/app-shell`, but the component it generates inherits the workspace `type` option. In workspaces that set `"@schematics/angular:component": { "type": "component" }`, such as those updated to v20, the component was generated as `app-shell.component.ts` and the import failed to resolve. (cherry picked from commit 0be52a8)
1 parent 250fae7 commit e9ae950

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • packages/schematics/angular/app-shell

‎packages/schematics/angular/app-shell/index.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ const appShellSchematic: RuleFactory<AppShellOptions> = createProjectSchematic(
210210
module: 'app.module.server.ts',
211211
project: options.project,
212212
standalone: isStandalone,
213+
// The `AppShell` import added above expects the default file path and a named export, so
214+
// the component must not inherit a `type`, `flat` or `exportDefault` from the workspace.
215+
type: '',
216+
flat: false,
217+
exportDefault: false,
213218
}),
214219
]);
215220
},

0 commit comments

Comments
 (0)