diff --git a/index.html b/index.html index 8669991..4b7581a 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,6 @@ - diff --git a/src/modules/pwa.ts b/src/modules/pwa.ts deleted file mode 100644 index e3c3499..0000000 --- a/src/modules/pwa.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type UserModule } from '~/types' - -// https://github.com/antfu/vite-plugin-pwa#automatic-reload-when-new-content-available -export const install: UserModule = ({ isClient, router }) => { - if (!isClient) - return - - router.isReady() - .then(async () => { - const { registerSW } = await import('virtual:pwa-register') - registerSW({ immediate: true }) - }) - .catch(() => {}) -} diff --git a/tsconfig.json b/tsconfig.json index f76bf3b..7a8e012 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,7 +21,7 @@ "vite-plugin-pages/client", "vite-plugin-vue-component-preview/client", // "vite-plugin-vue-layouts/client", - "vite-plugin-pwa/client", + // "vite-plugin-pwa/client", "unplugin-vue-macros/macros-global", // "vite-plugin-vue-layouts/client.d.ts" "vite-plugin-vue-meta-layouts/client.d.ts" diff --git a/vite.config.ts b/vite.config.ts index 6c8e19b..4566b52 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,7 +9,6 @@ import MetaLayouts from 'vite-plugin-vue-meta-layouts' import Components from 'unplugin-vue-components/vite' import AutoImport from 'unplugin-auto-import/vite' import Markdown from 'vite-plugin-vue-markdown' -import { VitePWA } from 'vite-plugin-pwa' import VueI18n from '@intlify/unplugin-vue-i18n/vite' import Inspect from 'vite-plugin-inspect' import Inspector from 'vite-plugin-vue-inspector' @@ -99,35 +98,6 @@ export default defineConfig({ }, }), - // https://github.com/antfu/vite-plugin-pwa - VitePWA({ - registerType: 'autoUpdate', - includeAssets: ['favicon.svg', 'safari-pinned-tab.svg'], - manifest: { - name: '合肥市南园学校19预科2班', - short_name: '合肥市南园学校19预科2班', - theme_color: '#ffffff', - icons: [ - { - src: '/pwa-192x192.png', - sizes: '192x192', - type: 'image/png', - }, - { - src: '/pwa-512x512.png', - sizes: '512x512', - type: 'image/png', - }, - { - src: '/pwa-512x512.png', - sizes: '512x512', - type: 'image/png', - purpose: 'any maskable', - }, - ], - }, - }), - // https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n VueI18n({ runtimeOnly: true,