Initial commit
This commit is contained in:
94
next.config.js
Normal file
94
next.config.js
Normal file
@@ -0,0 +1,94 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
output: 'standalone',
|
||||
|
||||
// Optimisations pour la production
|
||||
compress: true,
|
||||
poweredByHeader: false,
|
||||
generateEtags: false,
|
||||
|
||||
// Configuration des images optimisées
|
||||
images: {
|
||||
domains: ['btpxpress.lions.dev', 'api.lions.dev', 'security.lions.dev'],
|
||||
formats: ['image/webp', 'image/avif'],
|
||||
minimumCacheTTL: 60,
|
||||
dangerouslyAllowSVG: true,
|
||||
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
|
||||
},
|
||||
|
||||
// Optimisations de performance
|
||||
experimental: {
|
||||
optimizeCss: true,
|
||||
optimizePackageImports: ['primereact', 'primeicons'],
|
||||
},
|
||||
|
||||
// Configuration Turbopack (stable)
|
||||
turbopack: {
|
||||
rules: {
|
||||
'*.svg': {
|
||||
loaders: ['@svgr/webpack'],
|
||||
as: '*.js',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// Configuration du bundler simplifiée
|
||||
webpack: (config, { dev }) => {
|
||||
// Alias pour optimiser les imports
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
'@': require('path').resolve(__dirname),
|
||||
'@components': require('path').resolve(__dirname, 'components'),
|
||||
'@services': require('path').resolve(__dirname, 'services'),
|
||||
'@types': require('path').resolve(__dirname, 'types'),
|
||||
'@utils': require('path').resolve(__dirname, 'utils'),
|
||||
};
|
||||
|
||||
return config;
|
||||
},
|
||||
|
||||
// Headers de sécurité
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: '/(.*)',
|
||||
headers: [
|
||||
{
|
||||
key: 'X-Frame-Options',
|
||||
value: 'DENY'
|
||||
},
|
||||
{
|
||||
key: 'X-Content-Type-Options',
|
||||
value: 'nosniff'
|
||||
},
|
||||
{
|
||||
key: 'Referrer-Policy',
|
||||
value: 'strict-origin-when-cross-origin'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
},
|
||||
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: '/apps/mail',
|
||||
destination: '/apps/mail/inbox',
|
||||
permanent: true
|
||||
}
|
||||
];
|
||||
},
|
||||
|
||||
// Configuration des variables d'environnement
|
||||
env: {
|
||||
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
|
||||
NEXT_PUBLIC_KEYCLOAK_URL: process.env.NEXT_PUBLIC_KEYCLOAK_URL,
|
||||
NEXT_PUBLIC_KEYCLOAK_REALM: process.env.NEXT_PUBLIC_KEYCLOAK_REALM,
|
||||
NEXT_PUBLIC_KEYCLOAK_CLIENT_ID: process.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID,
|
||||
NEXT_PUBLIC_APP_ENV: process.env.NEXT_PUBLIC_APP_ENV,
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
Reference in New Issue
Block a user