2021-10-18 12:48:45 +02:00
const config = require ( './server/config.js' )
2022-10-12 12:45:09 +02:00
const locales = require ( './locales/index' )
2022-11-29 14:40:19 +01:00
2023-06-17 09:27:31 +02:00
const dns = require ( 'node:dns' )
dns . setDefaultResultOrder ( 'ipv4first' )
2022-02-08 22:54:47 +01:00
const isDev = ( process . env . NODE _ENV !== 'production' )
2019-04-03 00:25:12 +02:00
module . exports = {
2020-06-24 15:26:52 +02:00
telemetry : false ,
2021-02-09 12:17:39 +01:00
modern : ( process . env . NODE _ENV === 'production' ) && 'client' ,
2019-04-03 00:25:12 +02:00
/ *
* * Headers of the page
* /
head : {
meta : [
{ charset : 'utf-8' } ,
2019-09-11 19:12:24 +02:00
{ name : 'viewport' , content : 'width=device-width, initial-scale=1' }
2019-04-03 00:25:12 +02:00
] ,
} ,
2022-02-08 22:54:47 +01:00
dev : isDev ,
2021-10-18 12:48:45 +02:00
server : config . server ,
2019-04-03 00:25:12 +02:00
2021-12-02 10:47:37 +01:00
vue : {
config : {
2022-01-26 09:51:42 +01:00
ignoredElements : [ 'gancio-events' , 'gancio-event' ]
2021-12-02 10:47:37 +01:00
}
} ,
2022-05-03 15:23:55 +02:00
css : [ './assets/style.css' ] ,
2022-02-08 22:54:47 +01:00
2019-04-03 00:25:12 +02:00
/ *
2021-10-18 12:48:45 +02:00
* * Customize the progress - bar component
2019-04-03 00:25:12 +02:00
* /
2022-11-09 10:18:42 +01:00
loading : {
color : 'orangered' ,
height : '3px'
} , //'~/components/Loading.vue',
2019-04-03 00:25:12 +02:00
/ *
* * Plugins to load before mounting the App
* /
2019-05-30 12:04:14 +02:00
plugins : [
2023-03-19 23:26:57 +01:00
'@/plugins/helpers' ,
'@/plugins/time' , // datetime filters
2019-06-25 01:05:38 +02:00
'@/plugins/axios' , // axios baseurl configuration
2020-09-05 01:21:47 +02:00
'@/plugins/validators' , // inject validators
2020-12-04 17:29:43 +01:00
'@/plugins/api' , // api helpers
2022-11-29 14:40:19 +01:00
'@/plugins/i18n' ,
2024-11-12 14:10:24 +01:00
'@/plugins/formatter' ,
2020-12-04 17:29:43 +01:00
{ src : '@/plugins/v-calendar' , ssr : false } // v-calendar
2019-05-30 12:04:14 +02:00
] ,
2019-11-13 17:57:37 +01:00
2019-04-03 00:25:12 +02:00
/ *
* * Nuxt . js modules
* /
modules : [
// Doc: https://axios.nuxtjs.org/usage
2022-11-29 14:40:19 +01:00
'@nuxtjs/i18n' ,
2023-03-16 17:29:48 +01:00
'~/modules/axios-proxy.js' , // Note: import this before @nuxtjs/axios to override defaults of both instances: `$axios` available in context, and `axios` used in controllers
2021-10-21 20:49:49 +02:00
'@nuxtjs/axios' ,
'@nuxtjs/auth' ,
2022-11-27 03:38:05 +01:00
'@nuxtjs/sitemap' ,
[ 'cookie-universal-nuxt' , { alias : 'cookies' } ] ,
2019-04-03 00:25:12 +02:00
] ,
2021-02-09 12:17:39 +01:00
2022-05-26 11:10:40 +02:00
sitemap : {
hostname : config . baseurl ,
gzip : true ,
exclude : [
'/Admin' ,
'/settings' ,
'/export' ,
'/setup'
] ,
routes : async ( ) => {
if ( config . status === 'READY' ) {
2022-06-25 22:35:19 +02:00
try {
const Event = require ( './server/api/models/event' )
2022-08-26 15:19:09 +02:00
const events = await Event . findAll ( { where : { is _visible : true } } )
2022-06-25 22:35:19 +02:00
return events . map ( e => ` /event/ ${ e . slug } ` )
} catch ( e ) {
return [ ]
}
2022-06-19 23:52:10 +02:00
} else {
return [ ]
2022-05-26 11:10:40 +02:00
}
}
} ,
2022-10-12 12:45:09 +02:00
i18n : {
locales : Object . keys ( locales ) . map ( key => ( {
code : key ,
name : locales [ key ] ,
2023-02-07 17:44:23 +01:00
file : 'loader.js' ,
2024-10-27 22:02:45 +01:00
language : key
2022-10-12 12:45:09 +02:00
} ) ) ,
vueI18n : {
2022-11-29 14:40:19 +01:00
fallbackLocale : 'en' ,
silentTranslationWarn : true
2023-06-17 09:27:31 +02:00
} ,
2022-10-12 12:45:09 +02:00
langDir : 'locales' ,
lazy : true ,
strategy : 'no_prefix' ,
skipSettingLocaleOnNavigate : true ,
2024-11-11 12:31:43 +01:00
defaultLocale : 'en' ,
2022-10-12 12:45:09 +02:00
} ,
2022-05-26 11:10:40 +02:00
2024-05-16 18:13:52 +02:00
render : {
static : {
maxAge : "6000000"
}
} ,
2021-10-29 13:04:11 +02:00
serverMiddleware : [ 'server/routes' ] ,
2019-04-03 00:25:12 +02:00
/ *
* * Axios module configuration
2019-06-21 23:52:18 +02:00
* See https : //github.com/nuxt-community/axios-module#options
2019-04-03 00:25:12 +02:00
* /
axios : {
2019-06-07 17:02:33 +02:00
prefix : '/api'
2019-04-03 00:25:12 +02:00
} ,
2019-04-26 23:14:43 +02:00
auth : {
2022-10-31 17:04:31 +01:00
rewriteRedirects : true ,
fullPathRedirect : true ,
2020-01-27 00:47:03 +01:00
// localStorage: false, // https://github.com/nuxt-community/auth-module/issues/425
cookie : {
prefix : 'auth.' ,
2020-02-01 22:39:31 +01:00
options : {
maxAge : 60 * 60 * 24 * 30 * 12 * 5
}
2020-01-27 00:47:03 +01:00
} ,
2019-04-26 23:14:43 +02:00
strategies : {
local : {
endpoints : {
2020-01-27 00:47:03 +01:00
login : {
url : '../oauth/login' ,
method : 'post' ,
propertyName : 'access_token' ,
withCredentials : true ,
headers : { 'Content-Type' : 'application/x-www-form-urlencoded' }
} ,
2019-05-30 12:04:14 +02:00
logout : false ,
2022-11-04 12:22:21 +01:00
user : { url : '/user' , method : 'get' , propertyName : false , autoFetch : false }
2019-07-23 01:31:43 +02:00
} ,
2019-09-17 16:05:46 +02:00
tokenRequired : true ,
2019-07-23 01:31:43 +02:00
tokenType : 'Bearer'
2019-04-26 23:14:43 +02:00
}
}
} ,
2022-02-08 14:45:19 +01:00
buildModules : [ '@nuxtjs/vuetify' ] ,
2023-04-14 10:47:54 +02:00
vuetify : {
2024-01-14 22:02:07 +01:00
treeShake : true ,
defaultAssets : false ,
2023-11-20 17:43:18 +01:00
optionsPath : './vuetify.options.js'
} ,
2024-05-16 18:13:52 +02:00
hooks : {
listen ( server ) {
server . keepAliveTimeout = 35000 ;
server . headersTimeout = 36000 ;
}
} ,
2021-10-29 13:13:44 +02:00
build : {
2022-08-26 15:19:09 +02:00
extend ( config , { isDev , isClient } ) {
// ..
config . module . rules . push ( {
test : /\.mjs$/ ,
include : /node_modules/ ,
type : "javascript/auto"
} )
// Sets webpack's mode to development if `isDev` is true.
if ( isDev ) {
config . mode = 'development'
}
} ,
2021-10-29 13:13:44 +02:00
corejs : 3 ,
cache : true ,
2022-02-09 00:46:42 +01:00
hardSource : ! isDev ,
extractCSS : ! isDev ,
optimizeCSS : ! isDev
2020-07-25 21:41:22 +02:00
} ,
2019-04-03 00:25:12 +02:00
}