import { NgModule } from '@angular/core'
@NgModule({
imports: [
AModule,
BModule,
CModule,
DModule,
EModule,
FModule,
GModule,
IModule,
JModule,
KModule,
// ...
JustModule,
],
declarations: [ImportComponent],
})
export class ImportModule {}
For example, I have imported N+ modules in ImportModule
, but in the end only JustModule
is used by ImportComponent
, will the other modules be removed by Angular's compiler?
The version of Angular is v15.2.0
.
I tried looking at the compiled product in the development
environment and found that even the unused modules were imported (require
) by webpack. I don't know what the situation is in the production
environment.