Webpack plugin that generates a service worker using sw-precache that will cache webpack's bundles' emitted assets. You can optionally pass sw-precache configuration options to webpack through this plugin.
Browser: [Phantom XX | Chrome XX | Firefox XX | IE XX | Safari XX | Other XX]
Chrome 64
Current behavior:
just like #142, my index.html is generated by html-webpack-plugin, my config.js is copied from local with copy-webpack-plugin; in generated file service-worker.js, like this
Expected/desired behavior:
let system path to relative path
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with your:
BEFORE YOU SUBMIT please read the following:
webpack version: 4.20
sw-precache-webpack-plugin version: latest
Please tell us about your environment: Linux
Browser: [Phantom XX | Chrome XX | Firefox XX | IE XX | Safari XX | Other XX] Chrome 64 Current behavior: just like #142, my index.html is generated by html-webpack-plugin, my config.js is copied from local with copy-webpack-plugin; in generated file service-worker.js, like this
Expected/desired behavior: let system path to relative path
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with your:
function setOfCachedUrls(e) { return e.keys().then(function (e) { return e.map(function (e) { return e.url }) }).then(function (e) { return new Set(e) }) } self.addEventListener("install", function (e) { e.waitUntil(caches.open(cacheName).then(function (e) { return setOfCachedUrls(e).then(function (a) { return Promise.all(Array.from(urlsToCacheKeys.values()).map(function (t) { if (!a.has(t)) { var s = new Request(t, { credentials: "same-origin" }); return fetch(s).then(function (a) { if (!a.ok) throw new Error("Request for " + t + " returned a response with status " + a.status); return cleanResponse(a).then(function (a) { return e.put(t, a) }) }) } })) }) }).then(function () { return self.skipWaiting() })) }), self.addEventListener("activate", function (e) { var a = new Set(urlsToCacheKeys.values()); e.waitUntil(caches.open(cacheName).then(function (e) { return e.keys().then(function (t) { return Promise.all(t.map(function (t) { if (!a.has(t.url)) return e.delete(t) })) }) }).then(function () { return self.clients.claim() })) }), self.addEventListener("fetch", function (e) { if ("GET" === e.request.method) { var a, t = stripIgnoredUrlParameters(e.request.url, ignoreUrlParametersMatching); (a = urlsToCacheKeys.has(t)) || (t = addDirectoryIndex(t, "index.html"), a = urlsToCacheKeys.has(t)); !a && "navigate" === e.request.mode && isPathWhitelisted(["^(?!\/__).*"], e.request.url) && (t = new URL("/dist//index.html", self.location).toString(), a = urlsToCacheKeys.has(t)), a && e.respondWith(caches.open(cacheName).then(function (e) { return e.match(urlsToCacheKeys.get(t)).then(function (e) { if (e) return e; throw Error("The cached response that was expected is missing.") }) }).catch(function (a) { return console.warn('Couldn\'t serve response for "%s" from cache: %O', e.request.url, a), fetch(e.request) })) } });