Files
EpicNext-Cms/next.config.ts
T
openhands 127d5dcfa6
Local Build and Deploy / deploy (push) Failing after 48s
Upgrade plugin system: lifecycle hooks, dependency checks, enabled gating
- PluginDefinition: add license, homepage, dependencies, onEnable, onDisable
- store.ts: call onEnable/onDisable hooks on toggle, fix circular dependency
- admin-nav.ts: async allEnabledHubs/allEnabledNavGroups filters by enabled state
- layout.tsx: pass filtered nav groups to sidebar
- client.tsx: show Disabled/Missing deps badges, dim disabled plugins
- API: return dependency info, lifecycle hooks on PATCH
- Radio depends on API, Events depends on Notifications
2026-07-18 14:38:56 +02:00

113 lines
2.8 KiB
TypeScript

import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs";
import createNextIntlPlugin from "next-intl/plugin";
const securityHeaders = [
{ key: "X-DNS-Prefetch-Control", value: "on" },
{
key: "Strict-Transport-Security",
value: "max-age=63072000; includeSubDomains; preload",
},
{ key: "X-Frame-Options", value: "DENY" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=(), interest-cohort=()",
},
{
key: "Content-Security-Policy",
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-inline' https://challenges.cloudflare.com https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ https://static.cloudflareinsights.com",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: blob: https:",
"frame-src 'self' https://challenges.cloudflare.com https://www.google.com/recaptcha/",
"connect-src 'self' https: wss:",
"font-src 'self' data:",
"object-src 'none'",
"base-uri 'self'",
"form-action 'self'",
].join("; "),
},
];
const nextConfig: NextConfig = {
// 1. Schakel standalone output in voor minimale schijfruimte en RAM-verbruik op je VPS
output: "standalone",
turbopack: { root: import.meta.dirname },
serverExternalPackages: [
"@prisma/adapter-mariadb",
"mariadb",
"@prisma/client",
"lzma",
"sharp",
"pino",
"pino-pretty",
],
// Compress responses with gzip
compress: true,
// 2. Snelheidsoptimalisatie: Sla checks over tijdens de productiebuild op de server
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
// Cache pages longer in the router cache for faster back/forward navigation
experimental: {
staleTimes: {
dynamic: 30,
static: 180,
},
},
// Add caching headers for static assets
async headers() {
return [
{
source: "/(.*)",
headers: securityHeaders,
},
{
source: "/assets/(.*)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/images/(.*)",
headers: [{ key: "Cache-Control", value: "public, max-age=86400" }],
},
];
},
};
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
const config = withNextIntl(nextConfig);
export default withSentryConfig(config, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
// 3. Altijd op silent tijdens bouwen op je VPS om de log schoon te houden
silent: true,
telemetry: false,
widenClientFileUpload: true,
hideSourceMaps: true,
// 4. disableLogger Volledig Verwijderd (Turbopack handelt dit nu zelf af)
sourcemaps: {
disable: !process.env.SENTRY_AUTH_TOKEN,
},
});