NeahStable/next.config.mjs
2026-01-16 22:59:58 +01:00

92 lines
2.9 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
// Note: ESLint configuration is now done via .eslintrc.json or next lint command
// The eslint option in next.config.mjs is deprecated in Next.js 16
typescript: {
ignoreBuildErrors: false, // ✅ Réactivé - corriger les erreurs avant build
},
images: {
unoptimized: false, // ✅ Activé l'optimisation d'images
formats: ['image/avif', 'image/webp'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
{
protocol: 'http',
hostname: 'localhost',
port: '9000', // MinIO local
},
],
},
experimental: {
webpackBuildWorker: true,
parallelServerBuildTraces: true,
parallelServerCompiles: true,
},
// Turbopack: activé pour le développement, mais peut causer des problèmes en production
// Vercel utilisera son propre système de build optimisé
// turbopack: {},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'X-DNS-Prefetch-Control',
value: 'on'
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin'
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=()'
},
{
key: 'Content-Security-Policy',
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-eval' 'unsafe-inline'", // ⚠️ À restreindre davantage si possible
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: https: http://localhost:9000",
"font-src 'self' data:",
"connect-src 'self' https://*.slm-lab.net https://*.microsoft.com https://*.microsoftonline.com wss://*.slm-lab.net",
"frame-src 'self' https://*.slm-lab.net",
"frame-ancestors 'self' https://espace.slm-lab.net https://connect.slm-lab.net",
].join('; ')
}
]
}
]
},
// Configuration pour Vercel
// Assurez-vous que les variables d'environnement sont correctement configurées
env: {
// Les variables NEXT_PUBLIC_* sont automatiquement exposées par Next.js
// Pas besoin de les déclarer ici explicitement
},
};
export default nextConfig;