refactor: renderToString now returns a Promise if no callback is passed

This commit is contained in:
Clark Du 2017-10-16 11:29:09 +08:00
parent efd044fad6
commit f8bc7e2383
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9

View File

@ -3,7 +3,6 @@ import serialize from 'serialize-javascript'
import generateETag from 'etag'
import fresh from 'fresh'
import Tapable from 'tappable'
import pify from 'pify'
import serveStatic from 'serve-static'
import compression from 'compression'
import _ from 'lodash'
@ -167,9 +166,6 @@ export default class Renderer extends Tapable {
runInNewContext: false,
basedir: this.options.rootDir
}, this.options.render.bundleRenderer))
// Promisify renderToString
this.bundleRenderer.renderToString = pify(this.bundleRenderer.renderToString)
}
useMiddleware (m) {