import createNextIntlPlugin from 'next-intl/plugin'; import type { NextConfig } from 'next'; const nextConfig: NextConfig = { reactStrictMode: true, // The workspace packages ship TypeScript source with no build step. transpilePackages: ['@impuestos/contracts', '@impuestos/i18n', '@impuestos/rules'], output: 'standalone', // /api is proxied at runtime by app/api/[...path]/route.ts rather than by a rewrite, // so API_INTERNAL_URL stays a runtime setting. See the comment in that file. async headers() { return [ { // The bundler emits the service worker under /_next/static, and a worker may only // claim a scope at or below its own path unless the response says otherwise. // Security headers for everything else are set in proxy.ts, which does not run for // /_next. source: '/_next/static/service-worker/:path*', headers: [ { key: 'Service-Worker-Allowed', value: '/' }, // Production only: Next warns that a custom Cache-Control here interferes with // how the dev server serves its own assets, and it does. ...(process.env.NODE_ENV === 'production' ? [{ key: 'Cache-Control', value: 'no-cache, no-store, must-revalidate' }] : []), ], }, ]; }, }; export default createNextIntlPlugin('./src/i18n/request.ts')(nextConfig);