Nuxt/test/fixtures/spa/nuxt.config.js
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

35 lines
607 B
JavaScript

function modifyHtml (html) {
return html.replace(
'</body>',
`<!-- extra html from render:route hook added at ${Date.now()}--></body>`
)
}
export default {
mode: 'spa',
pageTransition: false,
render: {
http2: {
push: true
},
bundleRenderer: {
shouldPrefetch: () => true
}
},
build: {
filenames: {
app: '[name].js',
chunk: '[name].js'
}
},
router: {
middleware: 'middleware'
},
plugins: ['~/plugins/error.js'],
hooks: {
'render:route': (url, page, { req, res }) => {
page.html = modifyHtml(page.html)
}
}
}