Build Progressive Web Apps in VS Code on the go and like a pro. We have Workbox Support fully stacked too.
Workbox is a set of libraries to help you write and manage service workers and caching with the CacheStorage API.
Get started : How to use Workbox here
"vscode": "^1.8.0"
Install vscode-pwa. It's available in Visual Studio Marketplace! OR
Launch VS Code Quick Open ( Ctrl + P ), paste the following command and press enter.
ext install mayeedwin.vscode-pwa
Write the Service Worker and App Manifest really quick and like a pro!
Command | Purpose and where to type |
---|---|
register.service.worker |
register service worker in your landing page say index.html |
add.web.manifest |
link app.webmanifest to your pages in the head tag |
theme.color |
add theme color in your pages head tag |
app.manifest |
add manifest meta data in your empty app.webmanifest file |
Command | Purpose and where to type |
---|---|
basic.service.worker |
create simple service worker for simple static sites |
NOTE : Use and refer to workbox developer docs while using the following commands for e.g the most used and critical one, workbox routing
Command | Purpose and where to type |
---|---|
workbox.cdn |
import workbox cdn version |
workbox.registerRoute |
set caching routes |
workbox.assets |
cache assets i.e styles, js, workers, in your service worker |
workbox.images |
cache images, in your service worker |
workbox.external |
cache external resources from external orgins e.g fonts, in your service worker |
workbox.debug |
workbox config for debug or production builds, in your service worker |
workbox.window |
add faster new service worker installs and refresh, in your landing page |
Command | Purpose and where to type |
---|---|
workbox.precache |
workbox precache config code snippet in your say sw-config.js file |
Excerpt : When using a bundler to create your service worker, you install the Workbox packages you want to use from npm, and then you use import statements to directly reference the Workbox modules you want to use.
Read more here
Command | Purpose and where to type |
---|---|
workbox.packages |
import all workbox npm modules |
workbox.analytics |
add offline google analytics |
API / Feature | Command | Where to type |
---|---|---|
Web Share Target API | web.share.basic |
in your app manifest |
Web Share Target API - Accepting application changes | web.share.app |
in your app manifest |
Web Share Target API - Accepting files | web.share.files |
in your app manifest |
Web Share Target API - Accepting text | web.share.text |
in your app manifest |
App Screeshots Preview before PWA Installation | pwa.screenshots |
in your app manifest |
Load preview in your browser here
All good to go with ^ v0.5-beta!
This beta version allows you to import Workbox and use cache strategies like a pro already!
Latest release of vscode-pwa beta!
Enjoy 😊 🐥 and thanks for checking it out. Let's connect on twitter @mayeedwin1 : )