测试代码

1

server.set('views', path.join(__dirname, 'dist')) server.engine('.html', require('ejs').__express) server.set('view engine', 'ejs') route(server) function createRenderer (bundle, options) { return createBundleRenderer(bundle, Object.assign(options, { template: template, cache: LRU({ max: 1000, maxAge: 1000 * 60 * 15 }), basedir: resolve('./dist'), runInNewContext: false })) } let renderer let readyPromise if (isProd) { const bundle = require('./dist/front/vue-ssr-server-bundle.json') const clientManifest = require('./dist/front/vue-ssr-client-manifest.json') renderer = createRenderer(bundle,{ clientManifest }) }else{ readyPromise = require('./build/setup-dev-server')(server, (bundle, options) => { renderer = createRenderer(bundle, options) }) }

2