diff --git a/src/index.js b/src/index.js index c55a1b1c5..dabd62d18 100755 --- a/src/index.js +++ b/src/index.js @@ -36,7 +36,7 @@ i18n const root = ReactDOM.createRoot(document.getElementById('app')); root.render(); -if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { +if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator && process.env.SERVICE_WORKER_DISABLED !== 'true') { window.addEventListener('load', () => { navigator.serviceWorker.register('service-worker.js') .catch((registrationError) => { diff --git a/webpack.config.js b/webpack.config.js index ea1685592..4c40e322a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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