Webpack AoT build fails

Bug description:

Webpack AoT build fails when ng-bootstrap is in the mix. Several errors like the following appear:

ERROR in ./$$_gendir/~/@ng-bootstrap/ng-bootstrap/alert/alert.ngfactory.ts
Module parse failed: <PATH>\$$_gendir\node_modules\@ng-bootstrap\ng-bootstrap\alert\alert.ngfactory.ts Unexpected token (13:21)
You may need an appropriate loader to handle this file type.
| import * as i2 from '@ng-bootstrap/ng-bootstrap/alert/alert';
| import * as i3 from '@ng-bootstrap/ng-bootstrap/alert/alert-config';
| const styles_NgbAlert:any[] = ([] as any[]);
| export const RenderType_NgbAlert:i0.RendererType2 = i0.ɵcrt({encapsulation:2,styles:styles_NgbAlert,
|     data:{}});
 @ ./$$_gendir/ClientApp/app/app.module.server.ngfactory.ts 10:0-103
 @ ./ClientApp/boot.server.ts

Removing all references to ng-bootstrap resolves the build failure.

Solution proposed in #1381 has no effect. My tsconfig.json:

  "compilerOptions": {
    "module": "es2015",
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": true,
    "noImplicitAny": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "skipDefaultLibCheck": true,
    "skipLibCheck": true,
    "lib": [ "es6", "dom" ],
    "types": [ "webpack-env" ]
  "exclude": [ "bin", "node_modules" ],
  "atom": { "rewriteTsconfig": false }

Version info

Angular: 4.3.3

ngtools/webpack: 1.5.5

Webpack: 2.7.0

ng-bootstrap: 1.0.0-alpha.30

Bootstrap: 4.0.0-alpha.6

OS: Win 10

1 possible answer(s) on “Webpack AoT build fails