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:
co-authored by
Bartek Iwańczuk
Claude Opus 4.6
parent
400e217c5e
commit
8b0d42b82a
@@ -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",
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user