title: NG build failing Module parse failed: Unexpected token - nothing has changed
body: <p>2 days ago we suddently started to get build errors when deploying using gitlab ci. nothing has changed in the build scripts, no versions of NPM, NG or Angular have changed. Same compile commands work fine on our development machines. </p>
  
  <pre><code>    _                      _                 ____ _     ___
      / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
     / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
    / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
   /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                  |___/
  
  
  Angular CLI: 8.2.1
  Node: 10.16.2
  OS: linux x64
  Angular: 8.1.3
  ... animations, common, compiler, compiler-cli, core, forms
  ... language-service, platform-browser, platform-browser-dynamic
  ... router, service-worker
  
  Package                            Version
  ------------------------------------------------------------
  @angular-devkit/architect          0.801.3
  @angular-devkit/build-angular      0.801.3
  @angular-devkit/build-optimizer    0.801.3
  @angular-devkit/build-webpack      0.801.3
  @angular-devkit/core               8.1.3
  @angular-devkit/schematics         8.1.3
  @angular/cdk                       8.1.2
  @angular/cli                       8.2.1
  @angular/fire                      5.2.1
  @angular/http                      2.4.10
  @angular/material                  8.1.2
  @angular/material-moment-adapter   8.1.2
  @angular/pwa                       0.801.3
  @ngtools/webpack                   8.1.3
  @schematics/angular                8.1.3
  @schematics/update                 0.802.1
  rxjs                               6.5.2
  typescript                         3.4.5
  webpack                            4.35.2
  </code></pre>
  
  <pre><code>ng-build:
    stage: build
    image: node:10
    script: 
    - node --version
    - npm --version
    - rm -f package-lock.json
    - npm install
    - npm run-script version
    - npm run-script build-ci
    - cd dist &amp;&amp; npm pack
    artifacts:
      paths:
      - dist/*.tgz
  </code></pre>
  
  <p>Even when we try and rerun a previous successful build it now fails with the same error</p>
  
  <pre><code>ERROR in ./src/app/app-routing.module.ts 3:17
  Module parse failed: Unexpected token (3:17)
  File was processed with these loaders:
   * ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js
   * ./node_modules/@ngtools/webpack/src/index.js
  You may need an additional loader to handle the result of these loaders.
  | import { Routes } from '@angular/router';
  | import { AuthGuard } from './core/guards/auth.guard';
  &gt; const ɵ0 = () =&gt; import("./modules/auth/auth.module.ngfactory").then(mod =&gt; mod.AuthModuleNgFactory), ɵ1 = () =&gt; import("./modules/property/property.module.ngfactory").then(mod =&gt; mod.PropertyModuleNgFactory), ɵ2 = () =&gt; import("./modules/privacy/privacy.module.ngfactory").then(mod =&gt; mod.PrivacyModuleNgFactory), ɵ3 = () =&gt; import("./modules/homepage/homepage.module.ngfactory").then(mod =&gt; mod.HomepageModuleNgFactory), ɵ4 = () =&gt; import("./modules/calendar/calendar.module.ngfactory").then(mod =&gt; mod.CalendarModuleNgFactory), ɵ5 = () =&gt; import("./modules/statistics/statistics.module.ngfactory").then(mod =&gt; mod.StatisticsModuleNgFactory);
  | const routes = [
  |     {
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! gurubnb-frontend-app@0.0.0 build-ci: `ng build --configuration=ci`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the gurubnb-frontend-app@0.0.0 build-ci script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  </code></pre>
  
  <p>I dont get why something that previously worked would fail with no changes in versions or the code. Expect the build to still work.</p>