UI-UX/next.config.ts
iye 8c88943a06
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5m0s
feat(tos): point all static assets to volcano TOS bucket
资源已上传到 https://cyberstar.tos-cn-shanghai.volces.com/cyber-star/
代码改动:
- 新增 src/lib/tos.ts 提供 tosUrl(path) 工具,读 NEXT_PUBLIC_TOS_DOMAIN
- mock-data.ts: portrait/gallery 切到 .webp, videoUrl 走 TOS, 全部通过 tosUrl()
- page.tsx Hero PV 走 tosUrl("videos/hero-pv.mp4")
- next.config.ts 把火山 TOS 域名(沪/京)+ 火山 CDN 加进 images.remotePatterns 白名单
- .env.example 更新 NEXT_PUBLIC_TOS_DOMAIN 示例为实际桶域名

体积影响 (与之前打包给运维的 cyber-star-assets.tar.gz 一致):
- 立绘 5MB png → 100-300KB webp (-95%)
- 单人 solo 5-10MB mp4 → 1-3MB (-70%)
- Hero PV 45MB → 12MB (-70%)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 14:37:46 +08:00

19 lines
615 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// 关闭左下角的开发指示器dev overlay 角标)
devIndicators: false,
// 容器化部署:产出精简的 standalone 包node server.js 启动)
output: "standalone",
// next/image 远程域名白名单:火山 TOS 桶 + 后续 CDN 域名
images: {
remotePatterns: [
{ protocol: "https", hostname: "*.tos-cn-shanghai.volces.com" },
{ protocol: "https", hostname: "*.tos-cn-beijing.volces.com" },
{ protocol: "https", hostname: "*.volccdn.com" },
],
},
};
export default nextConfig;