title: Angular - How to exclude a lazy loaded module from prod build?
body: <p>I have an angular module for demo purposes (DevShowcaseModule). This module should not be included in the production build. In order to hide this demos from the endusers and prevent demo code errors in the production.</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>Angular Version: 7.2.5</li>
  <li>Angular CLI: 7.3.2</li>
  </ul>
  
  <p>This is my app-routing.module.ts</p>
  
  <pre><code>{
      path: APP_NAV_ITEMS.DEV_SHOWCASE,
      canActivate: [ AuthGuard ],
      loadChildren: './_dev-showcase/dev-showcase.module#DevShowcaseModule',
  }
  </code></pre>
  
  <p>I have tried to exclude the module folder from the tsconfig.json. But it doesnt work, i can still call the route and the demo module is loaded.</p>
  
  <pre><code>{
    "compileOnSave": false,
    "compilerOptions": {
      "baseUrl": "./",
      "importHelpers": true,
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "module": "es2015",
      "moduleResolution": "node",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
  
      "noUnusedLocals": true,
      "noUnusedParameters": true,
  
      "target": "es5",
      "typeRoots": [
        "node_modules/@types"
      ],
      "lib": [
        "es2018",
        "dom"
      ]
    },
    "exclude": [
      "app/_dev-showcase/*"
  
    ]
  }
  </code></pre>
  
  <p>Any idea how to do it properly? </p>
  
  <p>Thanks!</p>