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

35 lines
735 B
JavaScript
Raw Normal View History

2018-03-16 16:12:06 +00:00
export default {
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',
'~/modules/layout',
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'
}
},
2018-01-13 05:22:11 +00:00
['./modules/template', { baz: 'ping' }]
2017-11-19 14:35:11 +00:00
],
serverMiddleware: [
'./modules/middleware/midd2',
'~/modules/middleware/midd3'
],
hooks (hook) {
hook('ready', (nuxt) => {
2017-11-19 14:35:11 +00:00
nuxt.__ready_called__ = true
})
hook('build:done', (builder) => {
2017-11-19 14:35:11 +00:00
builder.__build_done__ = true
})
2017-12-07 08:09:49 +00:00
// Add hook for renderer
hook('render:before', (renderer) => {
2017-12-07 08:09:49 +00:00
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
}