Authored by 陈峰

cm

phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
\ No newline at end of file
... ...
const fs = require('fs');
const rp = require('request-promise');
const path = require('path');
const pkg = require('../../package.json');
const {createBundleRenderer} = require('vue-server-renderer');
... ... @@ -33,13 +34,15 @@ const render = (req, res, next) => {
};
if (!isDev) {
const serverBundle = require(`https://cdn.yoho.cn/yohoblk-wap/bundle/yoho-ssr-server-${pkg.version}.json`);
const clientManifest = require(`https://cdn.yoho.cn/yohoblk-wap/bundle/yoho-ssr-client-${pkg.version}.json`);
renderer = createBundleRenderer(serverBundle, {
runInNewContext: false,
template,
clientManifest
Promise.all([
rp(`https://cdn.yoho.cn/yohoblk-wap/bundle/yoho-ssr-server-${pkg.version}.json`, {json: true}),
rp(`https://cdn.yoho.cn/yohoblk-wap/bundle/yoho-ssr-client-${pkg.version}.json`, {json: true}),
]).then(results => {
renderer = createBundleRenderer(results[0], {
runInNewContext: false,
template,
clientManifest: results[1]
});
});
}
... ...