Investigate why both the MedicalProductModule aswell as the MedicalFeatureModule are treeshaken or something
During the build process for some reason both the MedicalProductModule and the MedicalFeatureModule are seemingly not there anymore. No constructors are called and the Modules are undefined after importing in the features module. The assumption is, they are treeshaken but we have no idea why.
import { MedicalProductModule } from '@rcc/common'
import { RccHcpUserManualModule } from '@rcc/features/user-manual/hcp-user-manual/hcp-user-manual.module'
console.log(MedicalProductModule) // This results in an undefined log
console.log(new MedicalProductModule()) // produces a webpack error
console.log(UpdateModule) // works just fine
@NgModule({
imports: [
MedicalProductModule,
After further testing with Carlos we figured out, that if a testModule which is put in the same place as the MedicalFeatureModule will also not be loaded. We found out though that the testMoudle would be loaded if we add a function thats is called. Like this for example
@NgModule({})
export class TestModule {
public constructor() {
console.log('TestModule')
}
public static note(): ModuleWithProviders<TestModule> {
console.log('TestModule.note')
return {
ngModule: TestModule,
providers: [
{ provide: 'test', useValue: 'test' }
]
}
}
}
Edited by Paul Lengert