0

I need to mdify the ngsw-worker.js file in angular14, but I am wondering is it possible or not!? and how can I rename the ngsw-worker.js to like ngsw.js?

this file is located in my app node-module

1 Answer 1

0

You register the script for your service worker when importing the ServiceWorkerModule in your application module:

imports: [
  ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production }),
],

You could pass any other file name for your service worker there with your custom content.

See for more information the official Angular documentation on the ServiceWorkerModule here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.