mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
35 lines
606 B
JavaScript
35 lines
606 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)
|
|
}
|
|
}
|
|
}
|