fix: register files generated by Vite plugins in static file cache (#3534)

Fixes #3487 

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
fry69
2026-03-29 20:04:46 +00:00
committed by GitHub
co-authored by Bartek Iwańczuk Claude Opus 4.6
parent 400e217c5e
commit 8b0d42b82a
6 changed files with 145 additions and 1 deletions
@@ -0,0 +1,5 @@
import { App, staticFiles } from "@fresh/core";
export const app = new App()
.use(staticFiles())
.fsRoutes();
@@ -0,0 +1,8 @@
export default function Home() {
return (
<div>
<h1>PWA Test</h1>
<p>Testing vite-plugin-pwa integration</p>
</div>
);
}
@@ -0,0 +1,27 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
plugins: [
fresh(),
VitePWA({
// Minimal configuration to generate PWA files
registerType: "autoUpdate",
includeAssets: [],
manifest: {
name: "Fresh PWA Test",
short_name: "PWA Test",
description: "Testing vite-plugin-pwa with Fresh",
theme_color: "#ffffff",
},
workbox: {
globPatterns: ["**/*.{js,css,html}"],
},
devOptions: {
enabled: true,
type: "module",
},
}),
],
});