Angular Service worker (ngsw-worker.js) is not generated in the "/dist" folder after running...

Discussão em 'Angular' iniciado por Philip Mutua, Janeiro 8, 2025.

  1. Philip Mutua

    Philip Mutua Guest

    I'm checking an NX project to see if the service worker is performing as planned. After running "ng build appname," I have a problem in that the Angular Service worker is not generated in the "/dist" folder. What can I do to fix this?

    Imported in the app.module as should below

    // PWA
    ServiceWorkerModule.register('ngsw-worker.js', {
    enabled:true,
    // Register the ServiceWorker as soon as the app is stable
    // or after 30 seconds (whichever comes first).
    registrationStrategy: 'registerWhenStable:30000',
    // registrationStrategy: 'registerImmediately'
    }),

    Continue reading...

Compartilhe esta Página