feat: integrate PWA support with @ducanh2912/next-pwa

Configure Progressive Web App capabilities for production builds, enabling offline support and installability. PWA is disabled in dev to avoid HMR conflicts, and switches the build to webpack since PWA tooling requires it.
This commit is contained in:
2026-06-10 13:18:26 +08:00
parent 2066934094
commit cd693b75ae
8 changed files with 2381 additions and 14 deletions
+15
View File
@@ -8,6 +8,21 @@ import { RootProviders } from "@/providers/root-providers";
export const metadata: Metadata = {
title: "cozsweet",
description: "cozsweet frontend (Next.js)",
// PWA:链接到 public/manifest.json(由 @ducanh2912/next-pwa 体系使用)
manifest: "/manifest.json",
// 浏览器顶栏 / Android PWA 顶栏颜色
themeColor: "#f84d96",
// iOS Safari "添加到主屏" 元数据
appleWebApp: {
capable: true,
statusBarStyle: "default",
title: "cozsweet",
},
// iOS 触屏图标
icons: {
icon: "/favicon.ico",
apple: "/favicon.ico",
},
};
export default function RootLayout({