mon-entreprise/site/vite-pwa-options.ts

50 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-08-03 15:00:50 +00:00
import { Options } from 'vite-plugin-pwa'
export const pwaOptions: Partial<Options> = {
// selfDestroying: true, // Unregister PWA
2022-08-03 15:00:50 +00:00
registerType: 'prompt',
strategies: 'injectManifest',
srcDir: 'source',
filename: 'sw.ts',
injectManifest: {
maximumFileSizeToCacheInBytes: 3000000,
manifestTransforms: [
(entries) => {
const manifest = entries.filter(
(entry) =>
!/assets\/.*(-legacy|lazy_)/.test(entry.url) &&
(entry.url.endsWith('.html')
? /(infrance|mon-entreprise)\.html/.test(entry.url)
: true)
2022-08-03 15:00:50 +00:00
)
return { manifest }
},
],
},
includeAssets: ['logo-*.png'],
2022-08-03 15:00:50 +00:00
manifest: {
start_url: '/',
name: 'Mon entreprise',
short_name: 'Mon entreprise',
description: "L'assistant officiel du créateur d'entreprise",
lang: 'fr',
orientation: 'portrait-primary',
display: 'minimal-ui',
theme_color: '#2975d1',
background_color: '#ffffff',
icons: [
{
src: '/favicon/android-chrome-192x192-shadow.png?v=2.0',
sizes: '192x192',
type: 'image/png',
},
{
src: '/favicon/android-chrome-512x512-shadow.png?v=2.0',
sizes: '512x512',
type: 'image/png',
},
],
},
}