How can I prevent CommonModule from being added to imports array in component generated by Angular 17 CLI? I can't find an option to add in angular.json to @schematics/angular:component
.
@Component({
selector: 'app-new-component',
standalone: true,
imports: [CommonModule], <---- I want this array to be empty while generate new component by "ng g c new-component"
templateUrl: './new-component.component.html',
styleUrl: './new-component.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class NewComponentComponent {}
The lack of imports
property satisfies me as well as empty imports
array.
The change has already landed in CLI the repo and will be available in 17.1
Until then, you can't do much beside doing the change yourself in the node_modules
and use patch-package.