title: Angular 6 Prod Function calls are not supported in decorators but '..Module' was called
body: <p>I have this error when trying to use angular2-json-schema-form &amp; build in prod</p>
  
  <blockquote>
    <p>ERROR in Error during template compile of 'DemoModule'
      Function calls are not supported in decorators but 'JsonSchemaFormModule' was called.
    I found out that the the error comes from: </p>
  </blockquote>
  
  <pre><code>@NgModule({
    declarations: [ AceEditorDirective, DemoComponent, DemoRootComponent ],
    imports: [
      BrowserModule, BrowserAnimationsModule, FlexLayoutModule, FormsModule,
      HttpClientModule, MatButtonModule, MatCardModule, MatCheckboxModule,
      MatIconModule, MatMenuModule, MatSelectModule, MatToolbarModule,
      RouterModule.forRoot(routes),
  
      NoFrameworkModule, MaterialDesignFrameworkModule,
      Bootstrap3FrameworkModule, Bootstrap4FrameworkModule,
  
      JsonSchemaFormModule.forRoot(   // the source of the Error
        NoFrameworkModule,
        MaterialDesignFrameworkModule,
        Bootstrap3FrameworkModule,
        Bootstrap4FrameworkModule
      )
    ],
    bootstrap: [ DemoRootComponent ]
  }) 
  </code></pre>
  
  <p>In the source code of the library they use something like this: </p>
  
  <pre><code>export class JsonSchemaFormModule {
    static forRoot(...frameworks): ModuleWithProviders {
      const loadFrameworks = frameworks.length ?
        frameworks.map(framework =&gt; framework.forRoot().providers[0]) :
        [{ provide: Framework, useClass: NoFramework, multi: true }];
      return {
        ngModule: JsonSchemaFormModule,
        providers: [
          JsonSchemaFormService, FrameworkLibraryService, WidgetLibraryService,
          ...loadFrameworks
        ]
      };
    }
  }
  </code></pre>
  
  <p>When I remove the variable <code>loadFramworks</code> I don't have the error but I can't seem to in inject the frameworks in the providers attribute</p>