Workbox, React, Typescript (configuration?) #2525
-
Hey guys, I'm new to snowpack and decided to use it on my new project. I'm planning on making it PWA(fully-offline). Is there a template/configuration where i could have a head start? Can't really find much on the web. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi @viinxent Interesting post! I'm exactly at the same point. Unfortunately I haven't found any example. An integration of the
The downside of this is that workbox is not really integrated. The I would like to write my service worker with TypeScript too, so how could we make Snowpack to transpile another TypeScript file? Maybe using this build plugin? |
Beta Was this translation helpful? Give feedback.
-
Just wanted to give this a follow-up as it's not that hard to integrate workbox with the 1. Create your |
Beta Was this translation helpful? Give feedback.
Hi @viinxent
Interesting post! I'm exactly at the same point. Unfortunately I haven't found any example.
An integration of the
generateSW
flow (https://developers.google.com/web/tools/workbox/modules/workbox-cli) is simple:workbox-cli
to your development dependenciesworkbox-config.js
by hand or with the wizard. Mine looks currently like this: