title: Unexpected value 'MyCustomModule' imported by the module 'AppModule'
body: <p>I am trying to migrate one of my angular2 custom library to RC.6 + Webpack. My directory structure is:</p>
  
  <pre><code>- src - source TS files
  - lib - transpiled JS files + definition files
  - dev - development app to test if it works / looks ok.
  - myCustomLib.js - barrel
  - myCustomLib.d.ts
  </code></pre>
  
  <p>Within <code>dev</code> folder try to run an app. I bootstrap my module:</p>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>import { BrowserModule }                from "@angular/platform-browser";
  import { NgModule }                     from "@angular/core";
  import { AppComponent }                 from "./app.component";
  import { MyCustomModule }               from "../../myCustomLib";
  
  @NgModule({
      imports: [
          BrowserModule,
          MyCustomModule
      ],
      declarations: [ AppComponent ],
      bootstrap: [ AppComponent ]
  })
  export class AppModule {
  }
  </code></pre>
  
  <p>Now using the webpack I bundle my dev app. </p>
  
  <p><strong>webpack.config.js</strong></p>
  
  <pre><code>module.exports = {
      entry: "./app/boot",
      output: {
          path: __dirname,
          filename: "./bundle.js",
      },
      resolve: {
          extensions: ['', '.js', '.ts'],
          modules: [
              'node_modules'
          ]
      },
      devtool: 'source-map',
      module: {
          loaders: [{
              test: /\.js$/,
              loader: 'babel-loader',
              exclude: /node_modules/
          }, {
              test: /\.ts$/,
              loader: 'awesome-typescript-loader',
              exclude: /node_modules/
          }]
      },
      watch: true
  };
  </code></pre>
  
  <p>But when I try to load the app I get a message:</p>
  
  <pre><code>metadata_resolver.js:230
  Uncaught Error: Unexpected value 'MyCustomModule' imported by the module 'AppModule'
  </code></pre>
  
  <p>My barrel file I import looks like:</p>
  
  <p><strong>myCustomLib.js</strong></p>
  
  <pre><code>export * from './lib/myCustomLib.module';
  </code></pre>
  
  <p>I found also <a href="https://github.com/angular/angular-cli/issues/1831#issuecomment-242401992">hint on similar topic on github</a>, but changing it to:</p>
  
  <pre><code>export { MyCustomModule } from './lib/myCustomLib.module';
  </code></pre>
  
  <p>did not help. I have also tried to import the module from <code>src</code> directory - same error. MyCustomModule should be ok as It was working fine with systemJS before.</p>
  
  <p><strong>myCustomLib.module.ts:</strong></p>
  
  <pre><code>import { NgModule }                     from '@angular/core';
  import { BrowserModule }                from '@angular/platform-browser';
  
  @NgModule({
      imports: [
          BrowserModule
      ]
  })
  export class MyCustomModule {}
  </code></pre>
  
  <p>Any idea what can be the reason of this error? I have seen similar topics here but no answer or hint helped.</p>
  
  <p><strong>Edit</strong>: To make the example even simpler I have removed all from  MyCustomModule - same problem... </p>