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

104 lines
2.0 KiB
JavaScript
Raw Normal View History

2018-03-16 16:12:06 +00:00
import path from 'path'
2017-12-12 10:25:41 +00:00
let _nuxt
2018-03-16 16:12:06 +00:00
export default {
render: {
dist: {
maxAge: ((60 * 60 * 24 * 365) * 2)
}
},
router: {
extendRoutes (routes, resolve) {
return [{
path: '/before-enter',
name: 'before-enter',
beforeEnter: (to, from, next) => { next('/') }
}, ...routes]
}
},
2016-12-21 19:51:43 +00:00
generate: {
2017-03-17 17:52:46 +00:00
routes: [
2018-03-18 23:41:14 +00:00
// TODO: generate with {build: false} does not scans pages!
'/noloading',
2018-03-18 23:41:14 +00:00
'/stateless',
'/css',
'/stateful',
'/head',
'/async-data',
'/validate',
'/redirect',
'/store-module',
2017-03-17 17:52:46 +00:00
'/users/1',
'/users/2',
'/тест雨',
'/skip-on-fail/success',
'/skip-on-fail/fail',
{ route: '/users/3', payload: { id: 3000 } }
],
interval: 200
2017-10-31 11:33:15 +00:00
},
head () {
return {
titleTemplate (titleChunk) {
return titleChunk ? `${titleChunk} - Nuxt.js` : 'Nuxt.js'
},
meta: [{ charset: 'utf-8' }]
2018-03-18 19:31:32 +00:00
}
},
2017-12-12 10:25:41 +00:00
modulesDir: path.join(__dirname, '..', '..', '..', 'node_modules'),
2017-10-31 11:33:15 +00:00
hooks: {
ready (nuxt) {
_nuxt = nuxt
2018-08-20 14:20:45 +00:00
nuxt.__hook_ready_called__ = true
2017-10-31 11:33:15 +00:00
},
build: {
done (builder) {
2018-08-20 14:20:45 +00:00
builder.__hook_built_called__ = true
}
},
render: {
routeDone (url) {
_nuxt.__hook_render_routeDone__ = url
}
},
2017-10-31 11:33:15 +00:00
bad: null,
'': true
},
pageTransition: false,
2020-05-18 11:58:48 +00:00
components: true,
plugins: [
'~/plugins/vuex-module',
'~/plugins/dir-plugin',
'~/plugins/inject'
],
serverMiddleware: [
{
path: '/api/test',
handler: (_, res) => res.end('Works!')
}
],
css: [
'~assets/app.css'
],
2017-11-21 07:38:12 +00:00
build: {
scopeHoisting: true,
publicPath: '',
followSymlinks: true,
splitChunks: {
layouts: true
},
postcss: {
preset: {
features: {
'custom-selectors': true
}
},
plugins: {
cssnano: {},
[path.resolve(__dirname, 'plugins', 'tailwind.js')]: {}
}
}
2017-11-21 07:38:12 +00:00
}
2016-12-21 19:51:43 +00:00
}