Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
Includes Helm chart (tcb-devportal), Jenkinsfile with homelab CI pipeline, and Next.js app source.
62 lines
1.3 KiB
TypeScript
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)
|