build: also uglify service worker

This commit is contained in:
Equim
2018-02-25 01:29:45 +08:00
parent 2ca22656d6
commit fe829aa850
2 changed files with 12 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
// Check to make sure service workers are supported in the current browser,
// and that the current page is accessed from a secure origin. Using a
// service worker from an insecure origin will trigger JS console errors.
const isLocalhost = Boolean(window.location.hostname === 'localhost' ||
var isLocalhost = Boolean(window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
@@ -26,7 +26,7 @@
// i.e. whether there's an existing service worker.
if (navigator.serviceWorker.controller) {
// The updatefound event implies that registration.installing is set
const installingWorker = registration.installing;
var installingWorker = registration.installing;
installingWorker.onstatechange = function() {
switch (installingWorker.state) {