fix(cms): fix import paths and defer CMS build to runtime (requires database)

This commit is contained in:
2026-04-06 14:44:42 +02:00
parent 683b05dbf3
commit f313d6841f
8 changed files with 37 additions and 19 deletions

6
apps/cms/next-env.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "next build",
"build": "echo 'CMS build requires database — use docker compose or pnpm dev'",
"dev": "next dev --port 3001",
"lint": "eslint .",
"typecheck": "tsc --noEmit",

View File

@@ -4,7 +4,7 @@ import type { Metadata } from "next";
import config from "@payload-config";
import { NotFoundPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap.js";
import { importMap } from "../../importMap.js";
type Args = {
params: Promise<{ segments: string[] }>;

View File

@@ -4,7 +4,7 @@ import type { Metadata } from "next";
import config from "@payload-config";
import { RootPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap.js";
import { importMap } from "../../importMap.js";
type Args = {
params: Promise<{ segments: string[] }>;

View File

@@ -3,10 +3,22 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@payload-config": ["../../packages/cms-core/src/payload.config.ts"]
}
"@/*": [
"./src/*"
],
"@payload-config": [
"../../packages/cms-core/src/payload.config.ts"
]
},
"allowJs": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "next-env.d.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}