Live preview e2e tests had no CSS when tested against prod. For all our other tests, we have a separate test/app directory that imports CSS. Otherwise, the root-level /app directory is used. For live-preview, we currently always run against test/live-preview/app, that has no CSS import. This PR adds a new test/live-preview/prod/app directory that imports CSS and is used when we run tests against prod. In order for this to work, I had to make import map generation smarter
33 lines
811 B
TypeScript
33 lines
811 B
TypeScript
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
|
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
|
import type { ServerFunctionClient } from 'payload'
|
|
|
|
import config from '@payload-config'
|
|
import '@payloadcms/next/css'
|
|
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts'
|
|
import React from 'react'
|
|
|
|
import { importMap } from './admin/importMap.js'
|
|
import './custom.scss'
|
|
|
|
type Args = {
|
|
children: React.ReactNode
|
|
}
|
|
|
|
const serverFunction: ServerFunctionClient = async function (args) {
|
|
'use server'
|
|
return handleServerFunctions({
|
|
...args,
|
|
config,
|
|
importMap,
|
|
})
|
|
}
|
|
|
|
const Layout = ({ children }: Args) => (
|
|
<RootLayout config={config} importMap={importMap} serverFunction={serverFunction}>
|
|
{children}
|
|
</RootLayout>
|
|
)
|
|
|
|
export default Layout
|