Files
mintel.me/apps/web/next.config.mjs
Marc Mintel 55c25ca203
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 11s
Build & Deploy / 🏗️ Build (push) Successful in 7m20s
Build & Deploy / 🚀 Deploy (push) Successful in 25s
Build & Deploy / 🩺 Smoke Test (push) Successful in 6s
Build & Deploy / 🔔 Notify (push) Successful in 4s
fix(build): add outputFileTracingIncludes to guarantee all MDX blog posts are bundled into the docker standalone image
2026-06-03 15:48:28 +02:00

92 lines
2.3 KiB
JavaScript

import withMintelConfig from "@mintel/next-config";
import createMDX from '@next/mdx';
import path from 'path';
import { fileURLToPath } from 'url';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: [
'canvas',
'sharp',
'puppeteer',
'require-in-the-middle',
'import-in-the-middle'
],
transpilePackages: [
'@mintel/content-engine',
'@mintel/concept-engine',
'@mintel/estimation-engine',
'@mintel/meme-generator',
'@mintel/pdf',
'@mintel/thumbnail-generator'
],
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*.your-objectstorage.com',
},
{
protocol: 'https',
hostname: 'fsn1.your-objectstorage.com',
},
],
},
async redirects() {
return [
{
source: '/case-studies/klz',
destination: '/case-studies/klz-cables',
permanent: true,
},
];
},
async rewrites() {
return {
beforeFiles: [
// Map Patttern: Global assets moved into KLZ showcase folder
{
source: '/assets/klz-cables.com/:path*',
destination: '/showcase/klz-cables.com/assets/klz-cables.com/:path*',
},
{
source: '/wp-content/:path*',
destination: '/showcase/klz-cables.com/wp-content/:path*',
},
{
source: '/wp-includes/:path*',
destination: '/showcase/klz-cables.com/wp-includes/:path*',
},
{
source: '/case-studies/assets/:directory/:path*',
destination: '/showcase/:directory/assets/:directory/:path*',
},
]
};
},
// In Standalone mode, Next.js expects the tracing root to be the monorepo root
outputFileTracingRoot: path.join(dirname, '../../'),
outputFileTracingIncludes: {
'/(site)/blog/[slug]': ['./content/blog/**/*'],
'/blog/[slug]': ['./content/blog/**/*'],
},
};
const withMDX = createMDX({});
// Clean, standard wrapper application
// Rewrites are now handled by src/middleware.ts for maximum robustness
const config = withMintelConfig(withMDX(nextConfig));
// Cleanup config to prevent Next.js 16 warnings about deprecated keys
if (config.serverActions) {
delete config.serverActions;
}
export default config;