-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnuxt.config.js
203 lines (190 loc) · 6.05 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
const webpack = require("webpack"); // eslint-disable-line
const fs = require("fs"); // eslint-disable-line
const packageJson = fs.readFileSync("./package.json");
const version = JSON.parse(packageJson).version || 0;
const routerBase = process.env.ROUTER_BASE || "/";
export default {
publicRuntimeConfig: {
devMode: process.env.NODE_ENV !== "production",
staticEndpoint:
process.env.STATIC_ENDPOINT ||
"https://app-reverse-proxy.osc.earthcode.eox.at/open-science-catalog-metadata",
staticBaseToReplace:
process.env.STATIC_BASE_TO_REPLACE ||
"https://esa-earthcode.github.io/open-science-catalog-metadata",
githubDataRoot:
process.env.GITHUB_DATA_ROOT ||
"https://github.com/ESA-EarthCODE/open-science-catalog-metadata/tree/main",
dynamicEndpoint:
process.env.DYNAMIC_ENDPOINT ||
"https://resource-catalogue.testing.opensciencedata.esa.int",
backendEndpoint:
process.env.BACKEND_ENDPOINT ||
"https://backend-api.testing.opensciencedata.esa.int",
authEnabled: process.env.ENABLE_AUTH || true,
workspaceRoot:
process.env.WORKSPACE_ROOT ||
"https://dashboard.earthcode-staging.earthcode.eox.at",
auth: {
strategies: {
oidc: {
clientId:
process.env.OAUTH_CLIENTID ||
"8c9fe79e-e0d7-45c9-8b0a-34c25058f8c1",
endpoints: {
configuration:
process.env.OPENID_CONFIGURATION ||
"https://auth.staging.opensciencedata.esa.int/.well-known/openid-configuration",
},
responseType: "token id_token",
// Not setting id token as it does not seem to be required for gluu
// idToken: {
// property: 'id_token',
// maxAge: 1800
// },
scope: process.env.OAUTH_SCOPE || "profile",
acrValues: ["passport_social"],
},
},
},
},
// Target: https://go.nuxtjs.dev/config-target
target: process.env.BUILD_MODE === "STATIC" ? "static" : "server",
// only for static mode
generate: {
fallback: true,
},
router: {
base: routerBase,
},
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
titleTemplate: "%s | ESA Open Science Catalog",
title: "ESA Open Science Catalog",
htmlAttrs: {
lang: "en",
},
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ property: "og:title", content: "ESA Open Science Catalog" },
{
hid: "description",
name: "description",
content:
"The Open Science Data Catalog features open access geoscience products, datasets and other resources produced by scientific research projects funded by ESA EO (Earth Observation).",
},
{
property: "og:description",
content:
"The Open Science Data Catalog features open access geoscience products, datasets and other resources produced by scientific research projects funded by ESA EO (Earth Observation).",
},
{
name: "keywords",
content:
"European Space Agency, Moon, Mars, sun, space exploration, probes, missions, satellites, launchers, international space station, ISS, telecommunications, earth observation, navigation, astronauts, solar system, universe, remote sensing, space news, ESA, environment, monitoring, astronomy, Ariane, rocket, Galileo, comet, education, Venus ",
},
{ name: "format-detection", content: "telephone=no" },
],
link: [
{ rel: "icon", type: "image/x-icon", href: `${routerBase}favicon.ico` },
],
script: [{ src: "/js/matomo.js" }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
"@/assets/global.scss",
"./static/css/materialdesignicons.min.css",
"./static/css/notesesabold.css",
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
"~/plugins/with-base",
"~/plugins/slugify",
"~/plugins/text-to-hex",
"~/plugins/type-color",
"~/plugins/axios",
"~/plugins/markdown",
"~/plugins/staticCatalogHelpers",
"~/plugins/item",
"~/plugins/metrics",
"~/plugins/eox-itemfilter.client",
"~/plugins/esa-cookies.client",
{ src: "~plugins/ol", ssr: false },
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/vuetify
"@nuxtjs/vuetify",
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
"@nuxtjs/axios",
"@nuxtjs/auth-next",
"@nuxt/content",
],
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
vuetify: {
customVariables: ["~/assets/variables.scss"],
treeShake: true,
defaultAssets: {
font: false,
icons: false,
},
options: {
customProperties: true,
},
theme: {
themes: {
light: {
primary: "#003247",
secondary: "#335E6F",
background: "#0F2733",
applications: "#00B19D",
},
},
},
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
plugins: [
new webpack.DefinePlugin({
"process.env": {
ROUTER_BASE: `"${routerBase}"`,
PACKAGE_VERSION: `"${version}"`,
},
}),
],
transpile: [
"@eox/itemfilter",
"@eox/map",
"color-parse",
"ol/renderer/webgl/PointsLayer",
"ol/structs/LRUCache",
"ol/style/Style",
"ol/geom/LineString",
"ol/format/Feature",
"ol/expr/gpu",
"ol/style/RegularShape",
"marked/lib/marked",
"chart.js",
],
},
auth: {
strategies: {
oidc: {
scheme: "~/auth/runtimeConfigurableScheme.js",
},
},
redirect: {
login: "/login",
logout: process.env.OAUTH_REDIRECT_LOGOUT || "/",
callback: process.env.OAUTH_REDIRECT_CALLBACK || "/oauth-callback",
home: "/",
},
fullPathRedirect: true,
},
};