init
Some checks failed
Code Quality / lint-and-build (push) Failing after 29s
Release Packages / release (push) Failing after 41s

This commit is contained in:
2026-01-31 19:26:46 +01:00
commit 9a0900e3ff
42 changed files with 8346 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# @mintel/next-config
Shared Next.js configuration wrapper for Mintel projects. Integrates `next-intl` and Sentry by default.
## Usage
In your `next.config.ts`:
```typescript
import mintelNextConfig from "@mintel/next-config";
const nextConfig = {
// Your project specific config
};
export default mintelNextConfig(nextConfig);
```

View File

@@ -0,0 +1,46 @@
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*`,
},
];
},
};
export default (config) => {
const nextIntlConfig = withNextIntl({ ...baseNextConfig, ...config });
return withSentryConfig(
nextIntlConfig,
{
silent: !process.env.CI,
treeshake: { removeDebugLogging: true },
},
{
authToken: undefined,
}
);
};

View File

@@ -0,0 +1,14 @@
{
"name": "@mintel/next-config",
"version": "1.0.0",
"publishConfig": {
"access": "public",
"registry": "https://npm.infra.mintel.me"
},
"type": "module",
"main": "index.js",
"dependencies": {
"next-intl": "^3.0.0",
"@sentry/nextjs": "^8.0.0"
}
}