@djangocfg/nextjs 2.1.474 → 2.1.475

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ var require_package = __commonJS({
14
14
  "package.json"(exports, module) {
15
15
  module.exports = {
16
16
  name: "@djangocfg/nextjs",
17
- version: "2.1.474",
17
+ version: "2.1.475",
18
18
  description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
19
19
  keywords: [
20
20
  "nextjs",
@@ -1450,27 +1450,10 @@ function createBaseNextConfig(options = {}) {
1450
1450
  const userHeaders = options.headers ? await options.headers() : [];
1451
1451
  return [...headers, ...userHeaders];
1452
1452
  },
1453
- // Rewrites — first-party analytics ingest proxy, then user rewrites.
1454
- //
1455
- // @djangocfg/analytics POSTs to a RELATIVE /cfg/analytics/collect/ so the beacon
1456
- // stays same-origin (sendBeacon is unreliable cross-origin). On a split-domain
1457
- // deploy (Next on one host, Django on `apiUrl`) that same-origin path has no
1458
- // route here, so every beacon 404s and nothing is ingested — unless we proxy it.
1459
- // Same-domain and static builds keep apiUrl empty and need no proxy.
1460
- ...apiUrl && !isStaticBuild || options.rewrites ? {
1461
- async rewrites() {
1462
- const analyticsProxy = apiUrl && !isStaticBuild ? [{ source: "/cfg/analytics/:path*", destination: `${apiUrl}/cfg/analytics/:path*` }] : [];
1463
- const user = options.rewrites ? await options.rewrites() : [];
1464
- if (Array.isArray(user)) {
1465
- return { beforeFiles: analyticsProxy, afterFiles: user, fallback: [] };
1466
- }
1467
- return {
1468
- beforeFiles: [...analyticsProxy, ...user?.beforeFiles ?? []],
1469
- afterFiles: user?.afterFiles ?? [],
1470
- fallback: user?.fallback ?? []
1471
- };
1472
- }
1473
- } : {},
1453
+ // Rewrites (user-provided only)
1454
+ ...options.rewrites && {
1455
+ rewrites: options.rewrites
1456
+ },
1474
1457
  // Redirects for URL normalization
1475
1458
  // Fixes "Failed to construct 'URL': Invalid URL" error with double slashes
1476
1459
  async redirects() {