44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import createNextIntlPlugin from 'next-intl/plugin';
|
|
import type { NextConfig } from 'next';
|
|
|
|
/**
|
|
* Points next-intl at the request config. Without this the message catalogs are
|
|
* never registered and every server-side `getTranslations` call fails at build
|
|
* time rather than at runtime — which is the good failure mode, but only if the
|
|
* plugin is wired up in the first place.
|
|
*/
|
|
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
|
|
|
|
const nextConfig: NextConfig = {
|
|
reactStrictMode: true,
|
|
|
|
/**
|
|
* Workspace packages ship TypeScript source rather than a build artefact, so
|
|
* Next compiles them with the app. No watch-and-rebuild step during local
|
|
* development, and dead code is tree-shaken per app.
|
|
*/
|
|
transpilePackages: ['@sport/ui'],
|
|
|
|
// Compile-time checked <Link href> values — a typo becomes a build failure.
|
|
typedRoutes: true,
|
|
|
|
images: {
|
|
// Media is served from R2/CDN. Locally that is MinIO.
|
|
remotePatterns: [
|
|
{ protocol: 'http', hostname: 'localhost', port: '9000' },
|
|
{ protocol: 'https', hostname: '**.r2.dev' },
|
|
{ protocol: 'https', hostname: 'cdn.sport-store.local' },
|
|
],
|
|
formats: ['image/avif', 'image/webp'],
|
|
},
|
|
|
|
// Standalone output keeps the production image small (no node_modules copy).
|
|
output: 'standalone',
|
|
|
|
experimental: {
|
|
optimizePackageImports: ['@sport/ui'],
|
|
},
|
|
};
|
|
|
|
export default withNextIntl(nextConfig);
|