2018-03-16 16:12:06 +00:00
|
|
|
import path from 'path'
|
2017-12-12 10:25:41 +00:00
|
|
|
|
2018-08-21 16:35:46 +00:00
|
|
|
let _nuxt
|
|
|
|
|
2018-03-16 16:12:06 +00:00
|
|
|
export default {
|
2018-08-10 09:34:55 +00:00
|
|
|
render: {
|
|
|
|
dist: {
|
|
|
|
maxAge: ((60 * 60 * 24 * 365) * 2)
|
|
|
|
}
|
|
|
|
},
|
2018-08-18 16:15:37 +00:00
|
|
|
router: {
|
2019-07-10 10:45:49 +00:00
|
|
|
extendRoutes (routes, resolve) {
|
2018-08-18 16:15:37 +00:00
|
|
|
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!
|
2018-08-06 00:12:44 +00:00
|
|
|
'/noloading',
|
2018-03-18 23:41:14 +00:00
|
|
|
'/stateless',
|
|
|
|
'/css',
|
|
|
|
'/stateful',
|
|
|
|
'/head',
|
|
|
|
'/async-data',
|
|
|
|
'/validate',
|
|
|
|
'/redirect',
|
2018-09-18 15:21:25 +00:00
|
|
|
'/store-module',
|
2017-03-17 17:52:46 +00:00
|
|
|
'/users/1',
|
|
|
|
'/users/2',
|
2018-11-25 14:52:37 +00:00
|
|
|
'/тест雨',
|
2020-06-03 19:35:28 +00:00
|
|
|
'/skip-on-fail/success',
|
|
|
|
'/skip-on-fail/fail',
|
2017-05-30 10:00:31 +00:00
|
|
|
{ route: '/users/3', payload: { id: 3000 } }
|
2017-04-24 08:30:05 +00:00
|
|
|
],
|
2019-08-25 22:41:32 +00:00
|
|
|
interval: 200
|
2017-10-31 11:33:15 +00:00
|
|
|
},
|
2019-07-10 10:45:49 +00:00
|
|
|
head () {
|
2018-11-07 22:33:09 +00:00
|
|
|
return {
|
2019-07-10 10:45:49 +00:00
|
|
|
titleTemplate (titleChunk) {
|
2018-11-07 22:33:09 +00:00
|
|
|
return titleChunk ? `${titleChunk} - Nuxt.js` : 'Nuxt.js'
|
2020-06-10 15:26:50 +00:00
|
|
|
},
|
|
|
|
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: {
|
2019-07-10 10:45:49 +00:00
|
|
|
ready (nuxt) {
|
2018-08-21 16:35:46 +00:00
|
|
|
_nuxt = nuxt
|
2018-08-20 14:20:45 +00:00
|
|
|
nuxt.__hook_ready_called__ = true
|
2017-10-31 11:33:15 +00:00
|
|
|
},
|
2018-08-20 12:19:09 +00:00
|
|
|
build: {
|
2019-07-10 10:45:49 +00:00
|
|
|
done (builder) {
|
2018-08-20 14:20:45 +00:00
|
|
|
builder.__hook_built_called__ = true
|
2018-08-20 12:19:09 +00:00
|
|
|
}
|
|
|
|
},
|
2018-08-21 16:35:46 +00:00
|
|
|
render: {
|
2019-07-10 10:45:49 +00:00
|
|
|
routeDone (url) {
|
2018-08-21 16:35:46 +00:00
|
|
|
_nuxt.__hook_render_routeDone__ = url
|
|
|
|
}
|
|
|
|
},
|
2017-10-31 11:33:15 +00:00
|
|
|
bad: null,
|
|
|
|
'': true
|
2017-11-16 10:56:41 +00:00
|
|
|
},
|
2019-04-20 10:01:59 +00:00
|
|
|
pageTransition: false,
|
2020-05-18 11:58:48 +00:00
|
|
|
components: true,
|
2018-09-18 16:06:55 +00:00
|
|
|
plugins: [
|
|
|
|
'~/plugins/vuex-module',
|
2018-10-27 16:41:42 +00:00
|
|
|
'~/plugins/dir-plugin',
|
2020-08-04 09:29:23 +00:00
|
|
|
'~/plugins/router-guard',
|
2018-10-27 16:41:42 +00:00
|
|
|
'~/plugins/inject'
|
2018-09-18 16:06:55 +00:00
|
|
|
],
|
2019-02-14 15:56:58 +00:00
|
|
|
serverMiddleware: [
|
|
|
|
{
|
|
|
|
path: '/api/test',
|
|
|
|
handler: (_, res) => res.end('Works!')
|
|
|
|
}
|
|
|
|
],
|
2020-02-24 22:47:43 +00:00
|
|
|
css: [
|
|
|
|
'~assets/app.css'
|
|
|
|
],
|
2017-11-21 07:38:12 +00:00
|
|
|
build: {
|
2017-12-08 10:10:57 +00:00
|
|
|
scopeHoisting: true,
|
2018-11-20 17:12:05 +00:00
|
|
|
publicPath: '',
|
2019-09-29 09:06:44 +00:00
|
|
|
followSymlinks: true,
|
2020-03-27 13:08:48 +00:00
|
|
|
splitChunks: {
|
|
|
|
layouts: true
|
|
|
|
},
|
2018-10-09 12:26:11 +00:00
|
|
|
postcss: {
|
|
|
|
preset: {
|
2018-07-25 16:38:49 +00:00
|
|
|
features: {
|
|
|
|
'custom-selectors': true
|
|
|
|
}
|
2018-10-09 12:26:11 +00:00
|
|
|
},
|
|
|
|
plugins: {
|
2018-11-12 21:18:50 +00:00
|
|
|
cssnano: {},
|
|
|
|
[path.resolve(__dirname, 'plugins', 'tailwind.js')]: {}
|
2018-10-09 12:26:11 +00:00
|
|
|
}
|
|
|
|
}
|
2017-11-21 07:38:12 +00:00
|
|
|
}
|
2016-12-21 19:51:43 +00:00
|
|
|
}
|