mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 17:15:48 +00:00
Merge pull request #1018 from NachoLZ/feature/disable-service-worker
Dev: add option to disable service worker
This commit is contained in:
commit
19c6e042fb
2 changed files with 2 additions and 1 deletions
|
|
@ -36,7 +36,7 @@ i18n
|
|||
const root = ReactDOM.createRoot(document.getElementById('app'));
|
||||
root.render(<App />);
|
||||
|
||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||
if (process.env.NODE_ENV === 'production' && process.env.SERVICE_WORKER_DISABLED !== 'true' && process.env.SERVICE_WORKER_DISABLED !== true && 'serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('service-worker.js')
|
||||
.catch((registrationError) => {
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ module.exports = (env, argv) => ({
|
|||
new webpack.EnvironmentPlugin({
|
||||
SENTRY_DSN: null,
|
||||
...env,
|
||||
SERVICE_WORKER_DISABLED: false,
|
||||
DEBUG: argv.mode !== 'production',
|
||||
VERSION: pachageJson.version,
|
||||
COMMIT_HASH
|
||||
|
|
|
|||
Loading…
Reference in a new issue