Production express server

The last changes we need to make to our code is the bundle renderer creation in the express server.

In the server.js file, replace the // TODO production comment with this:

const template = fs.readFileSync(templatePath, 'utf-8')
const bundle = require('./dist/vue-ssr-server-bundle.json')
const clientManifest = require('./dist/vue-ssr-client-manifest.json')
renderer = createBundleRenderer(bundle, {
runInNewContext: false,
template,
clientManifest,
})

We will read the HTML page template, the server bundle, and the client manifest. Then, we create a new bundle renderer since we won't have hot-reloading in production.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.70.203