2018-03-16 16:12:06 +00:00
|
|
|
export default function () {
|
2017-07-17 19:38:02 +00:00
|
|
|
let ctr = 1
|
|
|
|
|
|
|
|
// Add hook for module
|
2018-08-06 00:12:44 +00:00
|
|
|
this.nuxt.hook('modules:done', (moduleContainer) => {
|
2017-07-17 19:38:02 +00:00
|
|
|
this.nuxt.__module_hook = moduleContainer && ctr++
|
|
|
|
})
|
|
|
|
|
|
|
|
// Add hook for renderer
|
2018-08-06 00:12:44 +00:00
|
|
|
this.nuxt.hook('render:done', (renderer) => {
|
2017-07-17 19:38:02 +00:00
|
|
|
this.nuxt.__renderer_hook = renderer && ctr++
|
|
|
|
})
|
|
|
|
|
2018-05-03 19:49:37 +00:00
|
|
|
// Get data before data sent to client
|
2019-02-08 10:05:01 +00:00
|
|
|
// TODO: Remove in next major release
|
2018-08-06 00:12:44 +00:00
|
|
|
this.nuxt.hook('render:context', (data) => {
|
2018-05-03 19:49:37 +00:00
|
|
|
this.nuxt.__render_context = data
|
|
|
|
})
|
|
|
|
|
2017-07-17 19:38:02 +00:00
|
|
|
// Add hook for build
|
2018-08-06 00:12:44 +00:00
|
|
|
this.nuxt.hook('build:done', (builder) => {
|
2017-07-17 19:38:02 +00:00
|
|
|
this.nuxt.__builder_hook = builder && ctr++
|
|
|
|
})
|
2017-11-19 14:35:11 +00:00
|
|
|
|
2018-08-06 00:12:44 +00:00
|
|
|
this.nuxt.hook('build:done', (builder) => {
|
2017-11-19 14:35:11 +00:00
|
|
|
this.nuxt.__builder_plugin = builder && ctr++
|
|
|
|
})
|
2017-07-17 19:38:02 +00:00
|
|
|
}
|