Files
mintel.me/apps/web/next.config.mjs
Marc Mintel c505050cb4
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🏗️ Build (push) Successful in 9m38s
Build & Deploy / 🚀 Deploy (push) Successful in 24s
Build & Deploy / 🩺 Smoke Test (push) Failing after 4s
Build & Deploy / 🔔 Notify (push) Successful in 3s
chore: add diagnostic rewrite and automated asset smoke tests
2026-04-12 18:49:11 +02:00

93 lines
2.6 KiB
JavaScript

import withMintelConfig from "@mintel/next-config";
import { withPayload } from '@payloadcms/next/withPayload';
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' // Sentry 10+ instrumentation dependencies
],
transpilePackages: [
'@mintel/content-engine',
'@mintel/concept-engine',
'@mintel/estimation-engine',
'@mintel/meme-generator',
'@mintel/payload-ai',
'@mintel/pdf',
'@mintel/thumbnail-generator'
],
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*.your-objectstorage.com',
},
{
protocol: 'https',
hostname: 'fsn1.your-objectstorage.com',
},
],
},
async rewrites() {
return {
beforeFiles: [
// Assets requested from root
{
source: '/assets/:path*',
destination: '/showcase/klz-cables.com/assets/:path*',
},
{
source: '/wp-content/:path*',
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-content/:path*',
},
{
source: '/wp-includes/:path*',
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-includes/:path*',
},
// Assets requested relatively from case-studies/work/blog subpages
{
source: '/:folder(case-studies|work|blog)/assets/:path*',
destination: '/showcase/klz-cables.com/assets/:path*',
},
{
source: '/:folder(case-studies|work|blog)/wp-content/:path*',
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-content/:path*',
},
{
source: '/:folder(case-studies|work|blog)/wp-includes/:path*',
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-includes/:path*',
},
// Diagnostic rule
{
source: '/robots-test',
destination: '/robots.txt',
},
],
};
},
async redirects() {
return [
{
source: '/case-studies/klz',
destination: '/case-studies/klz-cables',
permanent: true,
},
];
},
outputFileTracingRoot: path.join(dirname, '../../'),
};
const withMDX = createMDX({
// Add markdown plugins here, as desired
});
export default withPayload(withMintelConfig(withMDX(nextConfig)));