mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-05-04 12:13:36 +08:00
webui: disable registerSW
This commit is contained in:
@@ -1,23 +1,14 @@
|
||||
import { createApp } from 'vue';
|
||||
import { createPinia } from 'pinia';
|
||||
import { router } from './router';
|
||||
import {createApp} from 'vue';
|
||||
import {createPinia} from 'pinia';
|
||||
import {router} from './router';
|
||||
import App from './App.vue';
|
||||
|
||||
import '@unocss/reset/tailwind-compat.css';
|
||||
import 'virtual:uno.css';
|
||||
|
||||
const pinia = createPinia();
|
||||
const { i18n } = useMyI18n();
|
||||
const {i18n} = useMyI18n();
|
||||
|
||||
if (window.matchMedia('(display-mode: standalone)').matches) {
|
||||
console.log('网页以 "standalone" 模式运行');
|
||||
if('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/sw.js')
|
||||
.then(() => { console.log('Service Worker Registered'); });
|
||||
}
|
||||
} else {
|
||||
console.log('网页未以 "standalone" 模式运行');
|
||||
}
|
||||
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
@@ -8,7 +8,6 @@ import VueRouter from 'unplugin-vue-router/vite';
|
||||
import { VueRouterAutoImports } from 'unplugin-vue-router';
|
||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
import isStandalone from "is-standalone";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -48,7 +47,7 @@ export default defineConfig({
|
||||
include: resolve(__dirname, './src/i18n/**'),
|
||||
}),
|
||||
VitePWA({
|
||||
injectRegister: 'auto',
|
||||
injectRegister: false,
|
||||
registerType: 'autoUpdate',
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
|
||||
Reference in New Issue
Block a user