提交 d9a6f1ca 编写于 作者: J JJ Kasper 提交者: Tim Neutkens

Move react-ssr-prepass import inside of (#7095)

ampBindInitData check
上级 f8978cc2
......@@ -2,7 +2,6 @@ import { IncomingMessage, ServerResponse } from 'http'
import { ParsedUrlQuery } from 'querystring'
import React from 'react'
import { renderToString, renderToStaticMarkup } from 'react-dom/server'
import ssrPrepass from 'react-ssr-prepass'
import {IRouterInterface} from '../lib/router/router'
import mitt, {MittEmitter} from '../lib/mitt';
import { loadGetInitialProps, isResSent } from '../lib/utils'
......@@ -313,6 +312,8 @@ export async function renderToHTML(
}
if (ampBindInitData) {
const ssrPrepass = require('react-ssr-prepass')
renderPage = async (
options: ComponentsEnhancer = {},
): Promise<{ html: string; head: any, dataOnly?: true}> => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册