Answer the question
In order to leave comments, you need to log in
Vue-cli-pwa-plugin how to include service worker in build?
I have a problem with the service worker
I don't understand how to correctly include the service worker in the webpack build in order to minify the file and have access to the env variables
I'm using the official plugin https://github.com/vuejs/vue-cli/tree/dev/ packages...
It adds file to connect service worker https://github.com/vuejs/vue-cli/blob/dev/packages...
There are 2 scenarios:
1. I add worker in public folder then worker is connected, but it is excluded from the webpack build process, it is not minified and has no access to env
2. I include the worker file in main.js, then it goes into dist/js/[hashname].js like other files and I can't include it via register-service-worker
How can I include a worker in the assembly so that there is minification and access to env?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question