failed attempt to use the PWA plugin

This commit is contained in:
Chris Kruining 2024-11-07 10:45:17 +01:00
parent d838b06e13
commit c4c87a4ab1
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2

View file

@ -1,4 +1,4 @@
import { defineConfig } from "@solidjs/start/config";
import { defineConfig } from '@solidjs/start/config';
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
@ -8,22 +8,66 @@ export default defineConfig({
},
plugins: [
VitePWA({
mode: 'development',
// srcDir: 'src',
// filename: 'claims-sw.ts',
strategies: 'injectManifest',
mode: 'development',
registerType: 'autoUpdate',
injectRegister: false,
// pwaAssets: { disabled: false, config: true, htmlPreset: '2023', overrideManifestIcons: true },
workbox: {
globPatterns: ['**/*.{js,css,html,svg,png,svg,ico}'],
cleanupOutdatedCaches: true,
clientsClaim: true,
},
injectManifest: {
globPatterns: ['**/*.{js,css,html,svg,png,svg,ico}'],
},
base: '/',
manifest: {
name: 'Calque',
short_name: 'Calque',
theme_color: '#f0f',
icons: [],
name: 'Calque - manage your i18n files',
short_name: 'KAAS',
description: 'Simple tool for maitaining i18n files',
icons: [
{
src: '/images/favicon.dark.svg',
type: 'image/svg+xml',
sizes: 'any'
}
],
display_override: ['window-controls-overlay'],
screenshots: [
{
src: '/images/screenshots/narrow.png',
type: 'image/png',
sizes: '538x1133',
form_factor: 'narrow'
},
{
src: '/images/screenshots/wide.png',
type: 'image/png',
sizes: '2092x1295',
form_factor: 'wide'
}
],
file_handlers: [
{
action: '/edit',
accept: {
'text/*': [
'.json'
]
}
}
]
},
devOptions: {
enabled: true,
type: 'module',
navigateFallback: 'index.html',
resolveTempFolder: () => './.output/public',
},
}),
],
@ -37,5 +81,8 @@ export default defineConfig({
prerender: {
crawlLinks: true,
},
routeRules: {
'/manifest.json': { static: true }
},
},
});