Angular cli build ..自定义导入功能模块

时间:2018-01-03 12:52:39

标签: angular angular-cli angular-module

在我的角度入门应用程序中,我将每个独立的功能分成它自己的模块并导入AppModule中的所有功能模块:

import { NgModule } from '@angular/core';
import { Router } from '@angular/router';

import { AppRoutingModule } from './app-routing.module';
import { CoreModule } from './core/core.module';
import { AppComponent } from './app.component';

import { BusinessAccountManagementModule } from './business-account-management/business-account-management.module';
import { InvestigationModule } from './investigation/investigation.module';


@NgModule({
  imports: [
    CoreModule, // this will provide CommonModule, RouterModule and  BrowserModule for us to use

    /* Feature Modules */
    BusinessAccountManagementModule,
    InvestigationModule,

    AppRoutingModule
  ],
  declarations: [
    AppComponent
  ],
  providers: [],
  bootstrap: [AppComponent]

})
export class AppModule {
  constructor(private router: Router) {
  }
}

我需要的是在我构建时自定义要导入的功能模块..

例如,如果我想构建包含BusinessAccountManagementModule的版本,那么我想做类似的事情:

  

ng build --featureModule BusinessAccountManagementModule

更多:

  

ng build --featureModule BusinessAccountManagementModule InvestigationModule ...

有没有机会这样做?

0 个答案:

没有答案