Closed simonhaenisch closed 5 years ago
@simonhaenisch as the outputTargets
has been remove from the config, is it still possible to avoid the use of service worker by settings its value to false?
like
export const config: Config = {
outputTargets: [
{
type: 'www',
serviceWorker: false
}
],
while developing its really useful to have no service worker cache active
@peterpeterparker not sure what you mean? outputTargets
is still in the config (line 6):
What's different after this PR here is that the custom service worker (src/sw.js
) has been removed. That means that the default behavior will take place, which is to auto-generate a service worker with good defaults.
When you run Stencil in development mode, e. g. stencil build --dev --watch --serve
, there is no service worker generated by default... there is a --service-worker
CLI flag to force-enable it during dev mode though (see this file).
If you want to disable the service worker for your prod build as well, then yeah you can still just set serviceWorker: false
or serviceWorker: null
and it'll be disabled entirely.
All clear, thx a lot @simonhaenisch for the clear explanation, it answers my question
As discussed with @adamdbradley, this removes the custom service worker code, and relies on the default service worker instead that is generated using Workbox (
generateSW
mode).See https://github.com/ionic-team/stencil-site/pull/246.