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

33 lines
672 B
JavaScript
Raw Normal View History

2017-05-14 22:33:31 +00:00
module.exports = {
2017-05-21 17:18:26 +00:00
loading: true,
2017-05-14 22:33:31 +00:00
modules: [
2017-11-19 14:35:11 +00:00
'~~/modules/basic',
2017-10-30 21:39:08 +00:00
'~/modules/hooks',
2017-05-31 14:58:36 +00:00
{
2017-07-06 22:27:27 +00:00
src: '~/modules/middleware',
2017-05-31 14:58:36 +00:00
options: {
foo: 'bar'
}
},
['./modules/template', {baz: 'ping'}]
2017-05-21 17:18:26 +00:00
],
serverMiddleware: [
'./modules/middleware/midd2'
2017-11-19 14:35:11 +00:00
],
hooks(hook) {
hook('ready', nuxt => {
nuxt.__ready_called__ = true
})
hook('build:done', builder => {
builder.__build_done__ = true
})
2017-12-07 08:09:49 +00:00
// Add hook for renderer
hook('render:before', (renderer) => {
renderer.useMiddleware({
path: '/use-middleware',
handler: '~/modules/middleware/use-middleware'
})
})
2017-11-19 14:35:11 +00:00
}
2017-05-14 22:33:31 +00:00
}