chore: doc temp remove PWA to fix server error (#7666)

This commit is contained in:
iamkun 2022-05-12 23:23:28 +08:00 committed by GitHub
parent 0c92e8a8d2
commit 591a7c32f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 63 deletions

View File

@ -30,13 +30,6 @@ export const head: HeadConfig[] = [
color: '#5bbad5',
},
],
[
'link',
{
rel: 'manifest',
href: '/manifest.webmanifest',
},
],
[
'meta',
{

View File

@ -8,7 +8,9 @@
</a>
</template>
<a href="mailto:element-plus@outlook.com" target="_blank">
<el-button :round="round">{{ homeLang['20'] }}</el-button>
<el-button style="overflow: hidden" :round="round">{{
homeLang['20']
}}</el-button>
</a>
</el-tooltip>
</div>

View File

@ -99,14 +99,12 @@ onMounted(async () => {
userPrefer.value = String(dayjs().unix())
}
}
if (isMirrorUrl()) {
// unregister sw on mirror site
navigator?.serviceWorker?.getRegistrations().then((registrations) => {
for (const registration of registrations) {
registration.unregister()
}
})
}
// unregister sw
navigator?.serviceWorker?.getRegistrations().then((registrations) => {
for (const registration of registrations) {
registration.unregister()
}
})
})
</script>
@ -144,9 +142,6 @@ onMounted(async () => {
<slot name="aside-bottom" />
</template>
</VPContent>
<ClientOnly>
<VPReloadPrompt v-if="!isMirrorUrl()" />
</ClientOnly>
<Debug />
</div>
</template>

View File

@ -9,7 +9,6 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
import Components from 'unplugin-vue-components/vite'
import Icons from 'unplugin-icons/vite'
import IconsResolver from 'unplugin-icons/resolver'
import { VitePWA } from 'vite-plugin-pwa'
import {
docPackage,
epPackage,
@ -98,49 +97,6 @@ export default defineConfig(async ({ mode }) => {
MarkdownTransform(),
Inspect(),
mkcert(),
VitePWA({
strategies: 'injectManifest',
srcDir: '.vitepress',
filename: 'sw.ts',
outDir: '.vitepress/dist',
includeAssets: ['images/**'],
injectManifest: {
manifestTransforms: [
(manifest) => {
for (const item of manifest) {
if (item.url.endsWith('index.html')) {
const url = item.url.replace('index.html', '')
item.url = url ? url : '/'
}
}
return { manifest }
},
],
},
manifest: {
id: '/',
name: 'Element Plus',
short_name: 'Element Plus',
description:
'a Vue 3 based component library for designers and developers',
icons: [
{
src: 'android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
theme_color: '#ffffff',
background_color: '#ffffff',
display: 'standalone',
},
}),
],
optimizeDeps: {
include: optimizeDeps,