Closed resir014 closed 5 years ago
Merging #525 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #525 +/- ##
=======================================
Coverage 81.38% 81.38%
=======================================
Files 153 153
Lines 4619 4619
Branches 68 68
=======================================
Hits 3759 3759
Misses 842 842
Partials 18 18
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 71b9091...56bc60c. Read the comment docs.
We can probably try and follow what create-react-app did to register/unregister our service worker, here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template-typescript/src/serviceWorker.ts
@dtinth Ah yeah! We can give this a try, then at the release after this we can experiment with Workbox more. I tried fiddling with Workbox at one point but I didn't go far. 😅
I'll get this merged later today.
Motivation
We used some kinda of hack to get the service worker URL to register it, but we can actually do it with serviceworker-webpack-plugin to be able to load up our custom service worker without having to rewrite everything in Workbox.
So we can keep our existing service worker, but to include it, we can simply do this:
Things to note
publicPath
is set at the/
directory. This means I needed to rewrite some configs in webpack to reflect that change (specifically with file output.).serviceworker-webpack-plugin
runtime, so I had to include the typings myself.