feat: initial commit — tcb_devportal Next.js app
Some checks failed
homelab-k8s-services/tcb_devportal/pipeline/head There was a failure building this commit
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.
This commit is contained in:
61
next.config.ts
Normal file
61
next.config.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user