Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed May 11, 2022
1 parent 4bf5cf0 commit 31ca263
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/next/server/post-process.ts
Expand Up @@ -180,7 +180,7 @@ class FontOptimizerMiddleware implements PostProcessMiddleware {

async function postOptimizeHTML(
pathname: string,
html: string,
content: string,
renderOpts: RenderOpts,
{ inAmpMode, hybridAmp }: { inAmpMode: boolean; hybridAmp: boolean }
) {
Expand Down Expand Up @@ -242,10 +242,10 @@ async function postOptimizeHTML(

for (const postProcessor of postProcessors) {
if (postProcessor) {
html = await postProcessor(html)
content = await postProcessor(content)
}
}
return html
return content
}

// Initialization
Expand All @@ -257,4 +257,4 @@ registerPostProcessor(
(options) => options.optimizeFonts || process.env.__NEXT_OPTIMIZE_FONTS
)

export { processHTML, postOptimizeHTML }
export { postOptimizeHTML }
2 changes: 1 addition & 1 deletion packages/next/server/render.tsx
Expand Up @@ -465,7 +465,6 @@ export async function renderToHTML(
ampPath = '',
pageConfig = {},
buildManifest,
fontManifest,
reactLoadableManifest,
ErrorDebug,
getStaticProps,
Expand Down Expand Up @@ -1740,6 +1739,7 @@ export async function renderToHTML(

const postOptimize = (html: string) =>
postOptimizeHTML(pathname, html, renderOpts, { inAmpMode, hybridAmp })

if (generateStaticHTML) {
const html = await streamToString(chainStreams(streams))
const optimizedHtml = await postOptimize(html)
Expand Down

0 comments on commit 31ca263

Please sign in to comment.