$ npm install --save-dev serviceworker-loader
var registerServiceWorker = require("serviceworker!./sw.js");
registerServiceWorker({ scope: '/' }).then(success, error);
This loader is based almost entirely on worker-loader by @sokra.
ServiceWorker loader for Webpack
$ npm install --save-dev serviceworker-loader
var registerServiceWorker = require("serviceworker!./sw.js");
registerServiceWorker({ scope: '/' }).then(success, error);
This loader is based almost entirely on worker-loader by @sokra.
When using this it would appear I can never resolve to know if its ready or not:
navigator.serviceWorker.ready.then(worker => {
console.log('Service Worker is Ready')
console.log(worker)
})
Dear @markdalgleish,
there has been an open, uncommented pull request for half a year now. It seems like you lost interest in maintaining this package. Hence, I ask of you to either recommence maintaining this project yourself or to transfer maintainance rights (mostly npm package ownership) to somebody else who is willing to maintain it, so all of us can use this module and keep updating it. I think @ConradIrwin or @autarc might be good candidates for this job :) It's not much to do after all.
Thanks.
Has anyone got with working with TypeScript? If so do you have an example?
I want to save in the cache all my webpack assets during the install
event.
However, I don't know, in advance, the name of my assets since their names is hashed.
Any idea on how I can get the assets list that will be output by webpack?
Maybe the good way to do it is to not use this loader but to write a webpack plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.