Files
web_sport/apps/storefront/next.config.ts
T

35 lines
997 B
TypeScript

import type { NextConfig } from 'next';
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 nextConfig;