Add PWA install support for mobile and desktop
Register service worker, install prompt UI, iOS meta tags, and document install steps in DEPLOY.md. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { createPwaPlugin } from './pwa.mts'
|
||||
import { missingAssetsPlugin } from './missing-assets-plugin.mjs'
|
||||
import { generateRewrites } from './rewrites.mts'
|
||||
import { generateSidebar } from './sidebar.mts'
|
||||
@@ -37,6 +38,9 @@ export default defineConfig({
|
||||
['meta', { name: 'msapplication-TileImage', content: '/apple-touch-icon.png' }],
|
||||
['meta', { name: 'apple-mobile-web-app-title', content: '道德经' }],
|
||||
['meta', { name: 'application-name', content: '道德经' }],
|
||||
['meta', { name: 'mobile-web-app-capable', content: 'yes' }],
|
||||
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
|
||||
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' }],
|
||||
],
|
||||
themeConfig: {
|
||||
logo: { src: '/favicon.ico', width: 24, height: 24 },
|
||||
@@ -54,7 +58,7 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
vite: {
|
||||
plugins: [missingAssetsPlugin()],
|
||||
plugins: [missingAssetsPlugin(), createPwaPlugin()],
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user