[ci] yarn format
This commit is contained in:
parent
f165004c10
commit
f45936074e
3 changed files with 14 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { VitePWA } from 'vite-plugin-pwa'
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
|
|
||||||
// Full Astro Configuration API Documentation:
|
// Full Astro Configuration API Documentation:
|
||||||
// https://docs.astro.build/reference/configuration-reference
|
// https://docs.astro.build/reference/configuration-reference
|
||||||
|
@ -11,6 +11,6 @@ import { VitePWA } from 'vite-plugin-pwa'
|
||||||
// @ts-check
|
// @ts-check
|
||||||
export default /** @type {import('astro').AstroUserConfig} */ ({
|
export default /** @type {import('astro').AstroUserConfig} */ ({
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [VitePWA()]
|
plugins: [VitePWA()],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { registerSW } from 'virtual:pwa-register'
|
import { registerSW } from 'virtual:pwa-register';
|
||||||
|
|
||||||
const updateSW = registerSW({
|
const updateSW = registerSW({
|
||||||
onNeedRefresh() {},
|
onNeedRefresh() {},
|
||||||
onOfflineReady() {
|
onOfflineReady() {
|
||||||
console.log("Offline ready");
|
console.log('Offline ready');
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
updateSW();
|
updateSW();
|
||||||
|
|
14
examples/with-vite-plugin-pwa/src/vite-env.d.ts
vendored
14
examples/with-vite-plugin-pwa/src/vite-env.d.ts
vendored
|
@ -1,11 +1,11 @@
|
||||||
declare module 'virtual:pwa-register' {
|
declare module 'virtual:pwa-register' {
|
||||||
export type RegisterSWOptions = {
|
export type RegisterSWOptions = {
|
||||||
immediate?: boolean
|
immediate?: boolean;
|
||||||
onNeedRefresh?: () => void
|
onNeedRefresh?: () => void;
|
||||||
onOfflineReady?: () => void
|
onOfflineReady?: () => void;
|
||||||
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
|
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void;
|
||||||
onRegisterError?: (error: any) => void
|
onRegisterError?: (error: any) => void;
|
||||||
}
|
};
|
||||||
|
|
||||||
export function registerSW(options?: RegisterSWOptions): (reloadPage?: boolean) => Promise<void>
|
export function registerSW(options?: RegisterSWOptions): (reloadPage?: boolean) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue