2019-07-10 10:45:49 +00:00
|
|
|
function modifyHtml (html) {
|
2019-06-27 20:17:43 +00:00
|
|
|
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',
|
2019-04-20 10:01:59 +00:00
|
|
|
pageTransition: false,
|
2018-01-29 03:59:05 +00:00
|
|
|
render: {
|
|
|
|
http2: {
|
2018-07-24 16:22:12 +00:00
|
|
|
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
|
|
|
}
|
2018-08-08 10:11:08 +00:00
|
|
|
},
|
2019-03-29 14:06:35 +00:00
|
|
|
router: {
|
|
|
|
middleware: 'middleware'
|
|
|
|
},
|
2019-06-27 20:17:43 +00:00
|
|
|
plugins: ['~/plugins/error.js'],
|
|
|
|
hooks: {
|
|
|
|
'render:route': (url, page, { req, res }) => {
|
|
|
|
page.html = modifyHtml(page.html)
|
|
|
|
}
|
|
|
|
}
|
2017-10-07 09:07:52 +00:00
|
|
|
}
|