fix(web): withPayload + redirect admin + externalized packages
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Final working pattern: withPayload via require() for build
compatibility, admin page replaced with redirect (no RootPage
import = no React #130), payload packages externalized from
turbopack bundle. Blog/changelog use server-side getPayload().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-06 09:16:38 +01:00
parent d3e60d4d82
commit 2be08ab85f
4 changed files with 26 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { withPayload } = require("@payloadcms/next/withPayload");
import env from "./env.config"; import env from "./env.config";
const INTERNAL_PACKAGES = [ const INTERNAL_PACKAGES = [
@@ -121,4 +124,4 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: env.ANALYZE, enabled: env.ANALYZE,
}); });
export default withBundleAnalyzer(config); export default withPayload(withBundleAnalyzer(config));

View File

@@ -0,0 +1,14 @@
import "@payloadcms/next/css";
import type { ReactNode } from "react";
export const metadata = {
title: "CMS — claudemesh",
};
export default function PayloadLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}

View File

@@ -0,0 +1,7 @@
import { redirect } from "next/navigation";
// Payload admin disabled in production standalone output.
// Use local dev server for CMS admin.
export default function PayloadAdminRedirect() {
redirect("/");
}

View File

@@ -0,0 +1 @@
export const importMap = {};