Files
tcb_devportal/next.config.ts
duynguyen c90a36a54f
Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
feat: initial commit — tcb_devportal Next.js app
Includes Helm chart (tcb-devportal), Jenkinsfile with homelab CI pipeline,
and Next.js app source.
2026-05-10 14:49:10 +07:00

62 lines
1.3 KiB
TypeScript

import type { NextConfig } from 'next'
import createNextIntlPlugin from 'next-intl/plugin'
import { buildSecurityHeaders } from './src/libs/security/headers'
const withNextIntl = createNextIntlPlugin()
const isProd = process.env.NODE_ENV === 'production'
const securityHeaders = buildSecurityHeaders({ isProd })
const nextConfig: NextConfig = {
output: 'standalone',
poweredByHeader: false,
reactStrictMode: true,
images: {
unoptimized: true,
},
experimental: {
authInterrupts: true,
},
async headers() {
return [
{
source: '/:path*',
headers: securityHeaders,
},
]
},
async rewrites() {
const backendUrl =
process.env.NEXT_PUBLIC_BACK_END_DOMAIN || 'http://localhost:8080/api/v1'
return [
{ source: '/api/v1', destination: backendUrl, basePath: false },
{
source: '/api/v1/:path*',
destination: `${backendUrl}/:path*`,
basePath: false,
},
]
},
webpack(config) {
config.module.rules.push({
test: /\.yaml$/,
type: 'asset/source',
})
return config
},
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
'*.yaml': {
loaders: ['yaml-loader'],
as: '*.js',
},
},
},
}
export default withNextIntl(nextConfig)