feat(chat): support ai photo viewing

This commit is contained in:
2026-06-23 10:33:20 +08:00
parent cebc8f7443
commit d81abd6efd
16 changed files with 160 additions and 45 deletions
+6 -14
View File
@@ -11,15 +11,6 @@ import { withSerwist } from "@serwist/turbopack";
* - 脚本侧:scripts/deploy/_deploy_lib.sh 同步 .next/ + public/
* - 服务器启动:`cd <path> && next start -H 0.0.0.0 -p 3000`
* 或用 PM2`pm2 start "next start" --name cozsweet`
*
* PWA 集成:`@serwist/turbopack` 在 build 阶段用 esbuild 编译 `src/app/sw.ts` 源文件。
* - Turbopack 原生支持 —— 不再需要 `--webpack` flag
* - SW 通过 Serwist Route Handlersrc/app/serwist/[[...slug]]/route.ts)在 `/serwist/sw.js` 服务
* - 客户端注册走 `<SerwistProvider swUrl="/serwist/sw.js">`(替代旧的 <SwRegister />
*
* 历史:
* - 之前用 @ducanh2912/next-pwawebpack-only),被迫用 `--webpack` 退 Turbopack
* - 切到 @serwist/turbopack 后拿回 Turbopack 的 dev/build 性能
*/
const nextConfig: NextConfig = {
experimental: {
@@ -27,10 +18,6 @@ const nextConfig: NextConfig = {
staticGenerationRetryCount: 0,
},
images: {
// Facebook OAuth 登录后,`picture.type(large)` 返回
// platform-lookaside.fbsbx.com/platform/profilepic/?asid=...&hash=...
// 该 URL 是**下载链接**而非可缓存图片,next/image 优化器需要显式 allowlist。
// graph.facebook.com 兜底:Graph 偶尔返回直链头像 / OG 图。
remotePatterns: [
{
protocol: "https",
@@ -40,8 +27,13 @@ const nextConfig: NextConfig = {
protocol: "https",
hostname: "graph.facebook.com",
},
{
protocol: "https",
hostname: "**.supabase.co",
pathname: "/storage/v1/object/public/**",
},
],
},
};
export default withSerwist(nextConfig);
export default withSerwist(nextConfig);