fix(payload): add importMap generation to build script and isolate UI imports
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Failing after 18m25s
Build & Deploy / 🧪 QA (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-03-06 13:54:16 +01:00
parent 6a6fbb6f19
commit e0ccf1cdfb
3 changed files with 144 additions and 23 deletions

View File

@@ -22,11 +22,22 @@ import { CrmContacts } from "./src/payload/collections/CrmContacts";
import { CrmInteractions } from "./src/payload/collections/CrmInteractions";
import { CrmTopics } from "./src/payload/collections/CrmTopics";
import { Projects } from "./src/payload/collections/Projects";
import { payloadChatPlugin } from "@mintel/payload-ai";
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const isCLI =
process.argv.includes("migrate") ||
process.argv.includes("generate:importmap");
let aiPlugin: any;
if (!isCLI) {
const { payloadChatPlugin } = await import("@mintel/payload-ai");
aiPlugin = payloadChatPlugin({
enabled: true,
mcpServers: [],
});
}
export default buildConfig({
admin: {
user: Users.slug,
@@ -85,29 +96,26 @@ export default buildConfig({
plugins: [
...(process.env.S3_ENDPOINT
? [
s3Storage({
collections: {
media: {
prefix: `${process.env.S3_PREFIX || "mintel-me"}/media`,
s3Storage({
collections: {
media: {
prefix: `${process.env.S3_PREFIX || "mintel-me"}/media`,
},
},
},
bucket: process.env.S3_BUCKET || "",
config: {
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY || "",
secretAccessKey: process.env.S3_SECRET_KEY || "",
bucket: process.env.S3_BUCKET || "",
config: {
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY || "",
secretAccessKey: process.env.S3_SECRET_KEY || "",
},
region: process.env.S3_REGION || "fsn1",
endpoint: process.env.S3_ENDPOINT,
forcePathStyle: true,
},
region: process.env.S3_REGION || "fsn1",
endpoint: process.env.S3_ENDPOINT,
forcePathStyle: true,
},
}),
]
}),
]
: []),
payloadChatPlugin({
enabled: true,
mcpServers: [],
}),
...(aiPlugin ? [aiPlugin] : []),
],
endpoints: [
{