新增sw的排除

This commit is contained in:
kura 2026-05-11 17:42:10 +08:00
parent 05d68f10b6
commit 0ae93f9bae
4 changed files with 27 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 582 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -1,45 +1,46 @@
import { defineConfig } from 'vite' import { defineConfig } from "vite";
import basicSsl from '@vitejs/plugin-basic-ssl' import basicSsl from "@vitejs/plugin-basic-ssl";
import vue from '@vitejs/plugin-vue' import vue from "@vitejs/plugin-vue";
import { VitePWA } from 'vite-plugin-pwa' import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: './', base: "./",
build: { build: {
// 开发阶段启用源码映射https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#需主动开启-sourcemap // 开发阶段启用源码映射https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#需主动开启-sourcemap
sourcemap: process.env.NODE_ENV === 'development', sourcemap: process.env.NODE_ENV === "development",
}, },
plugins: [ plugins: [
vue(), vue(),
basicSsl(), basicSsl(),
VitePWA({ VitePWA({
registerType: 'autoUpdate', registerType: "autoUpdate",
manifest: { manifest: {
name: 'P2P Explorer', name: "P2P Explorer",
short_name: 'P2P Explorer', short_name: "P2P Explorer",
description: 'P2P文件传输与浏览工具', description: "P2P文件传输与浏览工具",
theme_color: '#f5f5f5',//米色 theme_color: "#f5f5f5", //米色
background_color: '#f5f5f5', background_color: "#f5f5f5",
icons: [ icons: [
{ {
src: '/static/icon64.png', src: "/static/icon64.png",
sizes: '64x64', sizes: "64x64",
type: 'image/png' type: "image/png",
}, },
{ {
src: '/static/icon256.png', src: "/static/icon256.png",
sizes: '256x256', sizes: "256x256",
type: 'image/png' type: "image/png",
} },
] ],
}, },
workbox: { workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp}'], globPatterns: ["**/*.{js,css,html,ico,png,svg,webp}"],
runtimeCaching: [] navigateFallbackDenylist: [/^\/about(?:\/|$)/],
} runtimeCaching: [],
}) },
}),
], ],
server: { server: {
host: '0.0.0.0', host: "0.0.0.0",
}, },
}) });