Prevent infinite reloading service worker (#2785)
* Respect interval for service worker * Do not load sw by vie plugin * Move comment above
This commit is contained in:
parent
04b93cdc9b
commit
018b93aaa6
2 changed files with 5 additions and 1 deletions
|
@ -6,7 +6,7 @@ export const getAppDefaultUri = () => "/";
|
||||||
export const getAppMountUri = () =>
|
export const getAppMountUri = () =>
|
||||||
window.__SALEOR_CONFIG__.APP_MOUNT_URI || getAppDefaultUri();
|
window.__SALEOR_CONFIG__.APP_MOUNT_URI || getAppDefaultUri();
|
||||||
export const getApiUrl = () => window.__SALEOR_CONFIG__.API_URL;
|
export const getApiUrl = () => window.__SALEOR_CONFIG__.API_URL;
|
||||||
export const SW_INTERVAL = parseInt(process.env.SW_INTERVAL, 10);
|
export const SW_INTERVAL = parseInt(process.env.SW_INTERVAL, 10) || 300;
|
||||||
export const IS_CLOUD_INSTANCE = process.env.IS_CLOUD_INSTANCE === "true";
|
export const IS_CLOUD_INSTANCE = process.env.IS_CLOUD_INSTANCE === "true";
|
||||||
export const MARKETPLACE_URL = window.__SALEOR_CONFIG__.MARKETPLACE_URL;
|
export const MARKETPLACE_URL = window.__SALEOR_CONFIG__.MARKETPLACE_URL;
|
||||||
export const MARKETPLACE_SALEOR_APPS_PAGE_PATH =
|
export const MARKETPLACE_SALEOR_APPS_PAGE_PATH =
|
||||||
|
|
|
@ -70,6 +70,10 @@ export default defineConfig(({ command, mode }) => {
|
||||||
|
|
||||||
plugins.push(
|
plugins.push(
|
||||||
VitePWA({
|
VitePWA({
|
||||||
|
/*
|
||||||
|
We use 'register-service-worker' for registering sw.js.
|
||||||
|
*/
|
||||||
|
injectRegister: null,
|
||||||
strategies: "injectManifest",
|
strategies: "injectManifest",
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue