Nuxt/test/fixtures/spa/nuxt.config.js

35 lines
607 B
JavaScript
Raw Normal View History

function modifyHtml (html) {
return html.replace(
'</body>',
`<!-- extra html from render:route hook added at ${Date.now()}--></body>`
)
}
2018-03-16 16:12:06 +00:00
export default {
2017-10-07 09:07:52 +00:00
mode: 'spa',
pageTransition: false,
2018-01-29 03:59:05 +00:00
render: {
http2: {
push: true
2018-11-21 13:08:03 +00:00
},
bundleRenderer: {
shouldPrefetch: () => true
}
},
build: {
filenames: {
app: '[name].js',
chunk: '[name].js'
2018-01-29 03:59:05 +00:00
}
},
router: {
middleware: 'middleware'
},
plugins: ['~/plugins/error.js'],
hooks: {
'render:route': (url, page, { req, res }) => {
page.html = modifyHtml(page.html)
}
}
2017-10-07 09:07:52 +00:00
}