diff --git a/src/node/build.ts b/src/node/build.ts index ff9b20d..aa5ccd8 100644 --- a/src/node/build.ts +++ b/src/node/build.ts @@ -13,8 +13,8 @@ import { serializeState } from '../utils/state' import { buildLog, createRequest, getSize, removeLeadingSlash, resolveAlias, routesToPaths, withTrailingSlash } from './utils' import { getCritters } from './critial' import { render } from './server' -import { renderPreloadLinks } from './preload-links' import { detectEntry, renderHTML } from './html' +import { renderPreloadLinks } from './preload-links' export type SSRManifest = Record export interface ManifestItem { @@ -188,8 +188,10 @@ export async function build(ssgOptions: Partial = {}, viteC const html = jsdom.serialize() let transformed = (await onPageRendered?.(path, html, appCtx)) || html - if (critters) + if (critters) { transformed = (await crittersQueue.add(() => critters.process(transformed)))! + transformed = transformed.replace(/', `${styleTag}`) diff --git a/src/node/preload-links.ts b/src/node/preload-links.ts index 8e29d73..29df657 100644 --- a/src/node/preload-links.ts +++ b/src/node/preload-links.ts @@ -36,6 +36,7 @@ function renderPreloadLink(document: Document, file: string) { appendLink(document, { rel: 'stylesheet', href: file, + crossOrigin: '', }) } }