punimtag/viewer-frontend/next.config.ts
Tanya ff47c87e41
Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m4s
CI / lint-and-type-check (pull_request) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
feat: web video transcoding, admin playback, and viewer fixes
Add on-demand H.264/AAC web playback (RQ, ffmpeg) with API routes and
Next.js proxies; extend admin UI with WebPlaybackVideo and shared hooks.
Store transcode cache beside pending-photos (WEB_VIDEO_CACHE_DIR / UPLOAD_DIR)
and ignore data/web_videos. Centralize FastAPI URL helpers, optional Vite
and Next base paths for subfolder deploy, and fix modal reopen by using
router.replace when closing the home photo viewer. Include migration,
install scripts, deployment doc updates, and CI admin build env tweak.

Made-with: Cursor
2026-03-25 15:33:05 -04:00

40 lines
1.2 KiB
TypeScript

import type { NextConfig } from "next";
/** Subpath deploy (e.g. /punim-viewer). Omit or empty for local dev at /. */
function normalizeNextBasePath(raw: string): string {
const t = raw.trim().replace(/\/+$/, "");
if (!t) {
return "";
}
return t.startsWith("/") ? t : `/${t}`;
}
const nextBasePath = normalizeNextBasePath(process.env.NEXT_BASE_PATH || "");
const nextConfig: NextConfig = {
...(nextBasePath ? { basePath: nextBasePath } : {}),
images: {
// Configure remote patterns for external image sources (SharePoint, CDN, etc.)
remotePatterns: [
// SharePoint Online (Microsoft 365)
{
protocol: 'https',
hostname: '**.sharepoint.com',
},
// SharePoint Server (on-premises) - update with your domain
// Uncomment and update if using on-premises SharePoint:
// {
// protocol: 'https',
// hostname: 'sharepoint.yourcompany.com',
// },
// Add other CDN or image hosting domains as needed
],
// Enable image optimization in production
// In development, images are unoptimized for faster iteration
unoptimized: process.env.NODE_ENV === 'development',
},
};
export default nextConfig;