import type { NextConfig } from 'next' import { SITE_URLS, WEB_APP_BASE_PATH } from '@d3ro/core/web-urls' const nextConfig: NextConfig = { reactStrictMode: true, // 웹앱은 d3ro.chanpaca.net/app 아래에서 서빙된다. 사이트 브리지 워커가 /app/* 를 이 서버로 보낸다. basePath: WEB_APP_BASE_PATH, // NAS Docker 이미지(apps/web/Dockerfile)는 standalone 산출물만 복사한다. output: 'standalone', // monorepo workspace 패키지는 소스 TypeScript 그대로 번들 대상 transpilePackages: ['@d3ro/core', '@d3ro/ui', '@d3ro/i18n', '@d3ro/api-client'], experimental: { // MUI + Emotion 최적화 optimizePackageImports: ['@mui/material', '@mui/icons-material', '@d3ro/ui'] }, async redirects() { // 다운로드·릴리스 안내는 랜딩 사이트 한 벌만 둔다. source 는 basePath 가 붙어 /app/download, /app/releases(/…) 가 된다. return ['/download', '/releases/:path*'].map((source) => ({ source, destination: SITE_URLS.download, permanent: true })) } } export default nextConfig