52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
import createNextIntlPlugin from "next-intl/plugin";
|
|
import { withSentryConfig } from "@sentry/nextjs";
|
|
|
|
const withNextIntl = createNextIntlPlugin();
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
export const baseNextConfig = {
|
|
output: "standalone",
|
|
images: {
|
|
dangerouslyAllowSVG: true,
|
|
contentDispositionType: "attachment",
|
|
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
|
|
},
|
|
async rewrites() {
|
|
const umamiUrl = (
|
|
process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL ||
|
|
"https://analytics.infra.mintel.me"
|
|
).replace("/script.js", "");
|
|
const glitchtipUrl = process.env.SENTRY_DSN
|
|
? new URL(process.env.SENTRY_DSN).origin
|
|
: "https://errors.infra.mintel.me";
|
|
|
|
return [
|
|
{
|
|
source: "/stats/:path*",
|
|
destination: `${umamiUrl}/:path*`,
|
|
},
|
|
{
|
|
source: "/errors/:path*",
|
|
destination: `${glitchtipUrl}/:path*`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
const withMintelConfig = (config) => {
|
|
const nextIntlConfig = withNextIntl({ ...baseNextConfig, ...config });
|
|
|
|
return withSentryConfig(
|
|
nextIntlConfig,
|
|
{
|
|
silent: !process.env.CI,
|
|
treeshake: { removeDebugLogging: true },
|
|
},
|
|
{
|
|
authToken: undefined,
|
|
},
|
|
);
|
|
};
|
|
|
|
export default withMintelConfig;
|