mirror of
https://github.com/fmhy/edit.git
synced 2025-10-13 00:01:09 +11:00
added pwa integration
This commit is contained in:
parent
dc1cfc1364
commit
75bdb8b9b5
4 changed files with 16696 additions and 0 deletions
|
@ -4,6 +4,7 @@ import UnoCSS from 'unocss/vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import OptimizeExclude from 'vite-plugin-optimize-exclude'
|
import OptimizeExclude from 'vite-plugin-optimize-exclude'
|
||||||
import Terminal from 'vite-plugin-terminal'
|
import Terminal from 'vite-plugin-terminal'
|
||||||
|
import { VitePWA } from 'vite-plugin-pwa'
|
||||||
import { defineConfig } from 'vitepress'
|
import { defineConfig } from 'vitepress'
|
||||||
import {
|
import {
|
||||||
commitRef,
|
commitRef,
|
||||||
|
@ -43,11 +44,14 @@ export default defineConfig({
|
||||||
['meta', { name: 'og:locale', content: 'en' }],
|
['meta', { name: 'og:locale', content: 'en' }],
|
||||||
['link', { rel: 'icon', href: '/test.png' }],
|
['link', { rel: 'icon', href: '/test.png' }],
|
||||||
// PWA
|
// PWA
|
||||||
|
['link', { rel: 'manifest', href: '/manifest.json' }],
|
||||||
['link', { rel: 'icon', href: '/test.png', type: 'image/svg+xml' }],
|
['link', { rel: 'icon', href: '/test.png', type: 'image/svg+xml' }],
|
||||||
['link', { rel: 'alternate icon', href: '/test.png' }],
|
['link', { rel: 'alternate icon', href: '/test.png' }],
|
||||||
['link', { rel: 'mask-icon', href: '/test.png', color: '#7bc5e4' }],
|
['link', { rel: 'mask-icon', href: '/test.png', color: '#7bc5e4' }],
|
||||||
['meta', { name: 'keywords', content: meta.keywords.join(' ') }],
|
['meta', { name: 'keywords', content: meta.keywords.join(' ') }],
|
||||||
['link', { rel: 'apple-touch-icon', href: '/test.png', sizes: '192x192' }],
|
['link', { rel: 'apple-touch-icon', href: '/test.png', sizes: '192x192' }],
|
||||||
|
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
|
||||||
|
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'default' }],
|
||||||
// Bing site verification
|
// Bing site verification
|
||||||
[
|
[
|
||||||
'meta',
|
'meta',
|
||||||
|
@ -116,6 +120,58 @@ export default defineConfig({
|
||||||
filepath: './.cache/imports.json'
|
filepath: './.cache/imports.json'
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
VitePWA({
|
||||||
|
registerType: 'autoUpdate',
|
||||||
|
workbox: {
|
||||||
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
||||||
|
runtimeCaching: [
|
||||||
|
{
|
||||||
|
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
|
||||||
|
handler: 'CacheFirst',
|
||||||
|
options: {
|
||||||
|
cacheName: 'google-fonts-cache',
|
||||||
|
expiration: {
|
||||||
|
maxEntries: 10,
|
||||||
|
maxAgeSeconds: 60 * 60 * 24 * 365 // 365 days
|
||||||
|
},
|
||||||
|
cacheableResponse: {
|
||||||
|
statuses: [0, 200]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
manifest: {
|
||||||
|
name: 'FMHY - freemediaheckyeah',
|
||||||
|
short_name: 'FMHY',
|
||||||
|
description: 'The largest collection of free stuff on the internet!',
|
||||||
|
theme_color: '#7bc5e4',
|
||||||
|
background_color: '#ffffff',
|
||||||
|
display: 'standalone',
|
||||||
|
orientation: 'portrait',
|
||||||
|
scope: '/',
|
||||||
|
start_url: '/',
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: '/fmhy.ico',
|
||||||
|
sizes: '16x16',
|
||||||
|
type: 'image/x-icon'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: '/test.png',
|
||||||
|
sizes: '192x192',
|
||||||
|
type: 'image/png',
|
||||||
|
purpose: 'any maskable'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: '/test.png',
|
||||||
|
sizes: '512x512',
|
||||||
|
type: 'image/png',
|
||||||
|
purpose: 'any maskable'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}),
|
||||||
transformsPlugin(),
|
transformsPlugin(),
|
||||||
{
|
{
|
||||||
name: 'custom:adjust-order',
|
name: 'custom:adjust-order',
|
||||||
|
|
39
docs/public/manifest.json
Normal file
39
docs/public/manifest.json
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"name": "FMHY - freemediaheckyeah",
|
||||||
|
"short_name": "FMHY",
|
||||||
|
"description": "The largest collection of free stuff on the internet!",
|
||||||
|
"theme_color": "#7bc5e4",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"scope": "/",
|
||||||
|
"start_url": "/",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/fmhy.ico",
|
||||||
|
"sizes": "16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/test.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "any maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/test.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "any maskable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"categories": ["education", "entertainment", "lifestyle", "utilities"],
|
||||||
|
"screenshots": [
|
||||||
|
{
|
||||||
|
"src": "/banner2.png",
|
||||||
|
"sizes": "1280x720",
|
||||||
|
"type": "image/png",
|
||||||
|
"form_factor": "wide"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
16600
package-lock.json
generated
Normal file
16600
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -66,6 +66,7 @@
|
||||||
"typescript": "^5.8.2",
|
"typescript": "^5.8.2",
|
||||||
"unplugin-auto-import": "^0.18.3",
|
"unplugin-auto-import": "^0.18.3",
|
||||||
"vite-plugin-optimize-exclude": "^0.0.1",
|
"vite-plugin-optimize-exclude": "^0.0.1",
|
||||||
|
"vite-plugin-pwa": "^1.0.3",
|
||||||
"vite-plugin-terminal": "^1.2.0",
|
"vite-plugin-terminal": "^1.2.0",
|
||||||
"wrangler": "^3.114.1"
|
"wrangler": "^3.114.1"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue