c9f78ef25f
VitePress did not auto-inject SW registration; manual registerSW enables true app install on HTTPS. Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
411 B
TypeScript
19 lines
411 B
TypeScript
import DefaultTheme from 'vitepress/theme'
|
|
import { h } from 'vue'
|
|
import InstallApp from './InstallApp.vue'
|
|
|
|
if (typeof window !== 'undefined') {
|
|
import('virtual:pwa-register').then(({ registerSW }) => {
|
|
registerSW({ immediate: true })
|
|
})
|
|
}
|
|
|
|
export default {
|
|
extends: DefaultTheme,
|
|
Layout: () => {
|
|
return h(DefaultTheme.Layout, null, {
|
|
'layout-bottom': () => h(InstallApp),
|
|
})
|
|
},
|
|
}
|