@djangocfg/nextjs 2.1.474 → 2.1.476
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.
- package/dist/config/index.mjs +5 -22
- package/dist/config/index.mjs.map +1 -1
- package/dist/index.mjs +5 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/config/createNextConfig.ts +4 -27
package/dist/index.mjs
CHANGED
|
@@ -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.
|
|
17
|
+
version: "2.1.476",
|
|
18
18
|
description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
|
|
19
19
|
keywords: [
|
|
20
20
|
"nextjs",
|
|
@@ -1724,27 +1724,10 @@ function createBaseNextConfig(options = {}) {
|
|
|
1724
1724
|
const userHeaders = options.headers ? await options.headers() : [];
|
|
1725
1725
|
return [...headers, ...userHeaders];
|
|
1726
1726
|
},
|
|
1727
|
-
// Rewrites
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
// deploy (Next on one host, Django on `apiUrl`) that same-origin path has no
|
|
1732
|
-
// route here, so every beacon 404s and nothing is ingested — unless we proxy it.
|
|
1733
|
-
// Same-domain and static builds keep apiUrl empty and need no proxy.
|
|
1734
|
-
...apiUrl && !isStaticBuild || options.rewrites ? {
|
|
1735
|
-
async rewrites() {
|
|
1736
|
-
const analyticsProxy = apiUrl && !isStaticBuild ? [{ source: "/cfg/analytics/:path*", destination: `${apiUrl}/cfg/analytics/:path*` }] : [];
|
|
1737
|
-
const user = options.rewrites ? await options.rewrites() : [];
|
|
1738
|
-
if (Array.isArray(user)) {
|
|
1739
|
-
return { beforeFiles: analyticsProxy, afterFiles: user, fallback: [] };
|
|
1740
|
-
}
|
|
1741
|
-
return {
|
|
1742
|
-
beforeFiles: [...analyticsProxy, ...user?.beforeFiles ?? []],
|
|
1743
|
-
afterFiles: user?.afterFiles ?? [],
|
|
1744
|
-
fallback: user?.fallback ?? []
|
|
1745
|
-
};
|
|
1746
|
-
}
|
|
1747
|
-
} : {},
|
|
1727
|
+
// Rewrites (user-provided only)
|
|
1728
|
+
...options.rewrites && {
|
|
1729
|
+
rewrites: options.rewrites
|
|
1730
|
+
},
|
|
1748
1731
|
// Redirects for URL normalization
|
|
1749
1732
|
// Fixes "Failed to construct 'URL': Invalid URL" error with double slashes
|
|
1750
1733
|
async redirects() {
|