Angular 5 Service Worker not working : <p>I try to add service worker to my project after updating to angular 5 and have some problems. I add imports to app.module.ts: </p>

<pre><code>import {ServiceWorkerModule} from '@angular/service-worker';
import {environment} from '../environments/environment';
...
environment.production ? ServiceWorkerModule.register('/ngsw-worker.js') : [],
</code></pre>

<p>execute <code>$ ng set apps.0.serviceWorker=true</code> to allow service workers in project</p>

<p>generate config: </p>

<pre><code>{
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": [
          "/index.html"
        ],
        "versionedFiles": [
          "/*.bundle.css",
          "/*.bundle.js",
          "/*.chunk.js"
        ]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "resources": {
        "files": [
          "/assets/**"
        ]
      }
    }
  ],
  "dataGroups": [
    {
      "name": "api-performance",
      "urls": [
        "/",
        "/main",
        "/login",
        "/select-content"
      ],
      "cacheConfig": {
        "strategy": "performance",
        "maxSize": 100,
        "maxAge": "3d"
      }
    }
  ]
}
</code></pre>

<p>And manifest: </p>

<pre><code>{
  "name": "App",
  "short_name": "App",
  "start_url": "/login",
  "theme_color": "#00a2e8",
  "background_color": "#00a2e8",
  "display": "standalone",
 "icons": [
  {
   "src": "assets\/icons\/android-icon-36x36.png",
   "sizes": "36x36",
   "type": "image\/png",
   "density": "0.75"
  },
  {
   "src": "assets\/icons\/android-icon-48x48.png",
   "sizes": "48x48",
   "type": "image\/png",
   "density": "1.0"
  },
  {
   "src": "assets\/icons\/android-icon-72x72.png",
   "sizes": "72x72",
   "type": "image\/png",
   "density": "1.5"
  },
  {
   "src": "assets\/icons\/android-icon-96x96.png",
   "sizes": "96x96",
   "type": "image\/png",
   "density": "2.0"
  },
  {
   "src": "assets\/icons\/android-icon-144x144.png",
   "sizes": "144x144",
   "type": "image\/png",
   "density": "3.0"
  },
  {
   "src": "assets\/icons\/android-icon-192x192.png",
   "sizes": "192x192",
   "type": "image\/png",
   "density": "4.0"
  }
 ]
}
</code></pre>

<p>Then build it in production: </p>

<pre><code>ng build --prod --aot=false --build-optimizer=false
</code></pre>

<p>Http-server run in SSL mode, but lsit of service workers in chrome dev-tools is clear. What's wrong? May be this flags broke it --aot=false --build-optimizer=false?</p>
