feat: i18n PWA webmanifests (#805)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
18056038c7
commit
85ac005570
7 changed files with 190 additions and 73 deletions
|
@ -1,7 +1,5 @@
|
|||
import { isCI, isDevelopment } from 'std-env'
|
||||
import type { VitePWANuxtOptions } from '../modules/pwa/types'
|
||||
import { APP_NAME } from '../constants'
|
||||
import { getEnv } from './env'
|
||||
|
||||
export const pwa: VitePWANuxtOptions = {
|
||||
mode: isCI ? 'production' : 'development',
|
||||
|
@ -13,40 +11,9 @@ export const pwa: VitePWANuxtOptions = {
|
|||
strategies: 'injectManifest',
|
||||
injectRegister: false,
|
||||
includeManifestIcons: false,
|
||||
manifest: async () => {
|
||||
const { env } = await getEnv()
|
||||
const envName = `${env === 'release' ? '' : ` (${env})`}`
|
||||
return {
|
||||
scope: '/',
|
||||
id: '/',
|
||||
name: `${APP_NAME}${envName}`,
|
||||
short_name: `${APP_NAME}${envName}`,
|
||||
description: `A nimble Mastodon Web Client${envName}`,
|
||||
theme_color: '#ffffff',
|
||||
icons: [
|
||||
{
|
||||
src: 'pwa-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: 'pwa-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
},
|
||||
/*
|
||||
{
|
||||
src: 'logo.svg',
|
||||
sizes: '250x250',
|
||||
type: 'image/png',
|
||||
purpose: 'any maskable',
|
||||
},
|
||||
*/
|
||||
],
|
||||
}
|
||||
},
|
||||
manifest: false,
|
||||
injectManifest: {
|
||||
globPatterns: ['**/*.{js,json,css,html,txt,svg,png,ico,webp,woff,woff2,ttf,eot,otf,wasm}'],
|
||||
globPatterns: ['**/*.{js,json,css,html,txt,svg,png,ico,webp,woff,woff2,ttf,eot,otf,wasm,webmanifest}'],
|
||||
globIgnores: ['emojis/**'],
|
||||
},
|
||||
devOptions: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue