Builds the markers, data block and stand-in host for the CMS host injection
The pages carry the CMS markers (data block, list regions, JSON-LD price, inline price); PackagesProvider reads the host's data block after hydration and asks the API only when there is none; the site address comes from the block. A stand-in for the host (config/hostInjector.ts, --cms-data in the preview server) and browser tests check the behaviour with different data. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { AddressInfo } from 'node:net';
|
||||
import { resolve } from 'node:path';
|
||||
import type { InjectOptions } from '../../config/hostInjector.ts';
|
||||
import { startPreviewServer } from '../../config/previewServer.ts';
|
||||
|
||||
// De gebouwde site: `pnpm build` schrijft hem, de tests bouwen niets. Relatief
|
||||
@@ -12,7 +13,10 @@ export const clientDir = resolve('dist/client');
|
||||
// auditRoute zet de opt-in route /__audit/404 aan, zoals Lighthouse hem start.
|
||||
// De contact-API wordt standaard nagebootst (CI heeft geen CMS-host); een
|
||||
// test die iets anders nodig heeft vervangt het met page.route.
|
||||
export async function startServer(options: { auditRoute?: boolean } = {}) {
|
||||
// inject laat de server doen alsof de CMS-host de markers vult (hostInjector)
|
||||
export async function startServer(
|
||||
options: { auditRoute?: boolean; inject?: () => InjectOptions | null } = {},
|
||||
) {
|
||||
const server = await startPreviewServer(clientDir, 0, {
|
||||
contactStub: true,
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user