init native nextjs pwa

This commit is contained in:
2025-08-16 09:21:32 -04:00
parent dadf518c2d
commit fefd0c47d6
4 changed files with 65 additions and 629 deletions

View File

@@ -1,24 +1,49 @@
import type { NextConfig } from "next";
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === "development",
});
// const nextConfig: NextConfig = {
// /* config options here */
// reactStrictMode: true,
// };
const nextConfig: NextConfig = withPWA({
/* config options here */
const nextConfig: NextConfig = {
reactStrictMode: true,
output: "standalone",
images: {
formats: ["image/webp", "image/avif"],
},
});
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "X-Frame-Options",
value: "DENY",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
],
},
{
source: "/sw.js",
headers: [
{
key: "Content-Type",
value: "application/javascript; charset=utf-8",
},
{
key: "Cache-Control",
value: "no-cache, no-store, must-revalidate",
},
{
key: "Content-Security-Policy",
value: "default-src 'self'; script-src 'self'",
},
],
},
];
},
};
export default nextConfig;