This commit is contained in:
syuilo 2018-03-16 06:09:23 +09:00
parent 38735943ac
commit cac7230b06

View file

@ -405,8 +405,12 @@ export default class MiOS extends EventEmitter {
});
});
// Whether use raw version script
const raw = (localStorage.getItem('useRawScript') == 'true' && this.debug)
|| process.env.NODE_ENV != 'production';
// The path of service worker script
const sw = `/sw.${version}.${lang}.js`;
const sw = `/sw.${version}.${lang}.${raw ? 'raw' : 'min'}.js`;
// Register service worker
navigator.serviceWorker.register(sw).then(registration => {