mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 11:42:05 +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'));
|
const root = ReactDOM.createRoot(document.getElementById('app'));
|
||||||
root.render(<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', () => {
|
window.addEventListener('load', () => {
|
||||||
navigator.serviceWorker.register('service-worker.js')
|
navigator.serviceWorker.register('service-worker.js')
|
||||||
.catch((registrationError) => {
|
.catch((registrationError) => {
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ module.exports = (env, argv) => ({
|
||||||
new webpack.EnvironmentPlugin({
|
new webpack.EnvironmentPlugin({
|
||||||
SENTRY_DSN: null,
|
SENTRY_DSN: null,
|
||||||
...env,
|
...env,
|
||||||
|
SERVICE_WORKER_DISABLED: false,
|
||||||
DEBUG: argv.mode !== 'production',
|
DEBUG: argv.mode !== 'production',
|
||||||
VERSION: pachageJson.version,
|
VERSION: pachageJson.version,
|
||||||
COMMIT_HASH
|
COMMIT_HASH
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue