-
Notifications
You must be signed in to change notification settings - Fork 29
/
nuxt.config.js
125 lines (110 loc) · 2.49 KB
/
nuxt.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
const development = process.env.NODE_ENV !== 'production'
export default {
debug: true,
version: Date.now(),
generate: {
exclude: [
/^\/account/
]
},
target: 'server',
head: {
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'mask-icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,700&display=swap' },
{ rel: 'stylesheet', type: 'text/css', href: '/main.css' },
],
script: [
{ src: 'https://cdn.tailwindcss.com' }
]
},
css: [
],
plugins: [
'@/plugins/axios',
'@/plugins/highcharts'
],
// serverMiddleware: [
// '~/serverMiddleware/redirects.js'
// ],
router: {
scrollBehavior (to, from, savedPosition) {
return to.name === 'Home' && from.name === 'Home' ? savedPosition : { x: 0, y: 0 }
}
},
components: true,
modules: [
'@nuxtjs/axios',
'@nuxtjs/i18n',
'nuxt-ssr-cache',
],
i18n: {
locales: [
{ code: 'en', file: 'en.js' },
],
defaultLocale: 'en',
strategy: 'no_prefix',
langDir: '~/locales/',
vueI18n: {
fallbackLocale: 'en'
}
},
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
baseURL: process.env.API_URL
},
env: {
baseURL: process.env.API_URL
},
publicRuntimeConfig: {
axios: {
browserBaseURL: process.env.BROWSER_BASE_URL,
title: process.env.project_title,
logo: process.env.logo,
telegram: process.env.telegram,
facebook: process.env.facebook,
twitter: process.env.twitter,
linkedin: process.env.linkedin
}
},
privateRuntimeConfig: {
axios: {
baseURL: process.env.API_URL
}
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
publicPath: 'client/',
terser: {
// https://github.com/terser/terser#compress-options
terserOptions: {
compress: {
drop_console: false
}
}
}
},
cache: {
useHostPrefix: false,
pages: [
'/'
],
key (route, context) {
return development ? false : route
},
store: {
type: 'memory',
max: 100,
ttl: 60
}
}
}