feat(pwa): remove SvelteKitPWA plugin dependencies

Story 2: Remove SvelteKitPWA Plugin Dependencies
- Remove @vite-pwa/sveltekit from package.json dependencies
- Remove SvelteKitPWA plugin import and configuration from vite.config.ts
- Clean up plugin configuration including manifest, workbox, and devOptions
- Build process now works without plugin (service worker migration needed next)

Dependencies reduced by 309 packages
Build fails on workbox imports as expected - ready for Story 3

Refs: docs/plans/MigrateToNativeSvelteKitPWA.md
This commit is contained in:
Giancarmine Salucci
2025-12-22 05:28:42 +01:00
parent e8bcc09f29
commit c9b53e0dbe
4 changed files with 16 additions and 4775 deletions

View File

@@ -2,7 +2,6 @@ import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vitest/config';
import { playwright } from '@vitest/browser-playwright';
import { sveltekit } from '@sveltejs/kit/vite';
import { SvelteKitPWA } from '@vite-pwa/sveltekit';
import fs from 'fs';
export default defineConfig({
@@ -19,66 +18,7 @@ export default defineConfig({
}
},
plugins: [
SvelteKitPWA({
srcDir: './src',
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
strategies: 'injectManifest',
filename: 'service-worker.ts',
scope: '/',
base: '/',
selfDestroying: process.env.SELF_DESTROYING_SW === 'true',
// Disable automatic registration to prevent test environment issues
injectRegister: process.env.NODE_ENV === 'test' ? false : 'auto',
injectManifest: {
swSrc: 'src/service-worker.ts',
swDest: 'service-worker.js',
injectionPoint: 'self.__WB_MANIFEST',
// Additional build configuration for better reliability
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff,woff2}'],
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, // 4MB
},
manifest: {
short_name: 'InstaChef',
name: 'InstaChef Recipe Saver',
start_url: '/',
scope: '/',
display: 'standalone',
theme_color: "#ffffff",
background_color: "#ffffff",
icons: [
{ src: '/favicon.png', sizes: '192x192', type: 'image/png' },
{ src: '/favicon.png', sizes: '512x512', type: 'image/png' }
],
share_target: {
action: '/share',
method: 'GET',
enctype: 'application/x-www-form-urlencoded',
params: { title: 'title', text: 'text', url: 'url' }
}
},
workbox: {
globPatterns: ['client/**/*.{js,css,ico,png,svg,webp,woff,woff2}'],
cleanupOutdatedCaches: true,
skipWaiting: false, // Let service worker control this
clientsClaim: false, // Let service worker control this
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, // 4MB
runtimeCaching: [
{
urlPattern: /^https:\/\/api\./,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
networkTimeoutSeconds: 10
}
}
]
},
devOptions: {
enabled: process.env.NODE_ENV !== 'test', // Disable in test environment
suppressWarnings: true,
navigateFallback: '/',
},
}),tailwindcss(), sveltekit()],
tailwindcss(), sveltekit()],
test: {
expect: { requireAssertions: true },
projects: [