1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-07-02 00:59:23 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
SunWuyuan
ac0c491765
Revert "修复sw加载bug"
This reverts commit 4029e449d84f2390d0df44af3ba9ccb665f7b1ad.
2025-06-11 16:41:33 +08:00
SunWuyuan
b0541d1170
Revert "更新sw"
This reverts commit 31969b15b0e3eacc83acacebf18f7dc1eef90427.
2025-06-11 16:41:29 +08:00
SunWuyuan
cbddbeb0a1
Revert "添加壁纸模式,不构建sw"
This reverts commit 183214305540d86e56c34316ec52523d04af4ab2.
2025-06-11 16:41:22 +08:00
SunWuyuan
1832143055
添加壁纸模式,不构建sw 2025-06-11 16:17:35 +08:00
SunWuyuan
31969b15b0
更新sw 2025-06-11 16:03:44 +08:00
SunWuyuan
4029e449d8
修复sw加载bug 2025-06-11 15:55:53 +08:00
SunWuyuan
f66031cd18
路径改为相对路径 2025-06-11 15:45:17 +08:00

View File

@ -14,6 +14,7 @@ import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: './',
plugins: [ plugins: [
VueRouter(), VueRouter(),
Layouts(), Layouts(),
@ -39,7 +40,7 @@ export default defineConfig({
runtimeCaching: [ runtimeCaching: [
{ {
urlPattern: ({ url, sameOrigin }) => { urlPattern: ({ url, sameOrigin }) => {
return sameOrigin && url.pathname.startsWith('/assets/'); return sameOrigin && url.pathname.endsWith('/assets/');
}, },
handler: 'CacheFirst', handler: 'CacheFirst',
options: { options: {
@ -103,28 +104,28 @@ export default defineConfig({
theme_color: '#212121', theme_color: '#212121',
background_color: '#212121', background_color: '#212121',
display: 'standalone', display: 'standalone',
start_url: '/', start_url: './',
edge_side_panel: { edge_side_panel: {
default_path: '/', default_path: './',
}, },
icons: [ icons: [
{ {
src: '/pwa/image/pwa-64x64.png', src: './pwa/image/pwa-64x64.png',
sizes: '64x64', sizes: '64x64',
type: 'image/png' type: 'image/png'
}, },
{ {
src: '/pwa/image/pwa-192x192.png', src: './pwa/image/pwa-192x192.png',
sizes: '192x192', sizes: '192x192',
type: 'image/png' type: 'image/png'
}, },
{ {
src: '/pwa/image/pwa-512x512.png', src: './pwa/image/pwa-512x512.png',
sizes: '512x512', sizes: '512x512',
type: 'image/png' type: 'image/png'
}, },
{ {
src: '/pwa/image/maskable-icon-512x512.png', src: './pwa/image/maskable-icon-512x512.png',
sizes: '512x512', sizes: '512x512',
type: 'image/png', type: 'image/png',
purpose: 'maskable' purpose: 'maskable'
@ -134,10 +135,10 @@ export default defineConfig({
{ {
name: '随机点名', name: '随机点名',
short_name: '随机点名', short_name: '随机点名',
url: '/#random-picker', url: './#random-picker',
icons: [ icons: [
{ {
src: '/pwa/image/pwa-64x64.png', src: './pwa/image/pwa-64x64.png',
sizes: '64x64', sizes: '64x64',
type: 'image/png' type: 'image/png'
} }