forked from woudc/woudc-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
171 lines (170 loc) · 4.46 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
import colors from 'vuetify/es5/util/colors'
import pkg from './package.json'
export default {
telemetry: false, // disable prompt to collect annoynmous data from nuxt
router: {
base: process.env.WOUDC_UI_ROUTER_BASE || '/',
},
/*
** Global headers of the page
*/
head: {
titleTemplate: `%s - WOUDC`, // default title template
title: pkg.name || 'WOUDC',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content:
pkg.description ||
'A World Meteorological Organization (WMO) data centre supporting the Global Atmosphere Watch (GAW) program operated by Environment and Climate Change Canada.',
},
],
link: [
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: process.env.WOUDC_UI_ROUTER_BASE + '/wmo-favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: process.env.WOUDC_UI_ROUTER_BASE + '/wmo-favicon-16x16.png',
},
],
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: ['@mdi/font/css/materialdesignicons.min.css'],
/*
** Plugins to load to $root instance before mounting the App
*/
plugins: ['~/plugins/woudcMeta.js'],
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
'@nuxtjs/vuetify',
'@nuxtjs/google-fonts',
['@nuxtjs/dotenv', { filename: '.env' }],
],
/*
** Nuxt.js modules
*/
modules: ['@nuxtjs/axios', '@nuxtjs/pwa', '@nuxtjs/i18n', 'nuxt-leaflet'],
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
vuetify: {
defaultAssets: false, // defaults to local mdi icons and font
theme: {
themes: {
light: {
primary: '#085eab',
secondary: '#1bb4d4',
// success: '#83EF9E',
// info: '#B3E5FC',
// warning: '#FFF59D',
// error: '#EF9A9A',
accent: '#faa52e',
},
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
},
},
},
/*
** nuxt-i18n module global options
*/
i18n: {
locales: [
{
code: 'fr',
iso: 'fr-CA',
name: 'Français',
},
{
code: 'en',
iso: 'en-CA',
name: 'English',
},
],
strategy: 'prefix',
defaultLocale: 'en',
vueI18n: {
fallbackLocale: ['en', 'fr'],
messages: {
en: require('./locales/en.json'),
fr: require('./locales/fr.json'),
},
},
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'woudc_default_language',
},
baseUrl: process.env.WOUDC_UI_BASE_URL + process.env.WOUDC_UI_ROUTER_BASE,
},
/*
** Build configuration
*/
ssr: true, // false for SPA mode, true for full static mode
target: 'static', // static hosting
googleFonts: {
// Vuetify default font:
// https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap
families: {
Roboto: [100, 300, 400, 500, 700, 900],
},
display: 'swap',
download: true,
overwriting: true,
},
build: {
filenames: {
// app: '[name].js'
},
},
generate: {
fallback: '200.html',
exclude: [
// dynamically generated pages to use SPA fallback
/\/data\/stations\/[\d]+$/,
/\/donnees\/stations\/[\d]+$/,
/\/contributors\/[\d\w-_]{1,8}$/,
/\/contributeurs\/[\d\w-_]{1,8}$/,
/\/data\/dataset-information/,
/\/donnees\/information-sur-les-jeux-de-donnees/,
],
},
publicRuntimeConfig: {
WOUDC_UI_BASE_URL: process.env.WOUDC_UI_BASE_URL,
WOUDC_UI_API_URL: process.env.WOUDC_UI_API_URL,
WOUDC_UI_EMAIL_ADDRESS: process.env.WOUDC_UI_EMAIL_ADDRESS,
WOUDC_UI_WAF_URL: process.env.WOUDC_UI_WAF_URL,
WOUDC_UI_WMO_REGIONS_URL: process.env.WOUDC_UI_WMO_REGIONS_URL,
WOUDC_UI_OWS_URL: process.env.WOUDC_UI_OWS_URL,
appBuildYYYY: new Date().getFullYear(),
appVersion: pkg.version,
appName: pkg.name,
appHomepage: pkg.homepage,
},
}