-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnuxt.config.ts
155 lines (140 loc) · 4.74 KB
/
nuxt.config.ts
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
import { resolve } from 'path';
import DocsModule from './modules/docs/module.mjs';
// Types
import { LOCALES } from './types/locales';
import { PluginOption } from 'vite';
/** UNIT TESTING
* When testing the application, vue + vuetify are not available,
* thus we have to import/plug them in manually
* however, in dev mode or when building this causes an ERROR,
* that is why we only add vue + vuetify in when testing
*/
import vue from '@vitejs/plugin-vue';
import vuetify from 'vite-plugin-vuetify';
let vitePlugins: PluginOption[] = [];
if (process.env.NODE_ENV === 'test') vitePlugins = [vue(), vuetify({ autoImport: true })];
export default defineNuxtConfig({
//==============================================================
// Base configuration
//==============================================================
telemetry: false,
sourcemap: {
server: true,
client: false
},
vue: {
runtimeCompiler: true
},
typescript: {
// Disable, because Takeover mode and Volar should be used
shim: false,
tsConfig: {
compilerOptions: {
// Allow type imports without `type` modifier
verbatimModuleSyntax: false,
noUncheckedIndexedAccess: false,
noImplicitAny: false,
strictNullChecks: false,
skipLibCheck: true
}
}
},
// Apply a transition to every page
app: {
pageTransition: { name: 'page', mode: 'out-in' }
},
// Disable SSR as the app is deployed using static site generation (SSG)
ssr: false,
// Available via useRuntimeConfig().public
// When changing env vars: change `Dockerfile` and `startup.sh` accordingly!
runtimeConfig: {
public: {
version: process.env.npm_package_version || 'latest',
build: process.env.CI_COMMIT_SHORT_SHA || '0000000',
buildTime: new Date(parseInt(process.env.CI_COMMIT_TIMESTAMP || Date.now().toString(), 10)).toISOString(),
buildNumber: process.env.CI_JOB_ID || '-1',
apiUrl: process.env.VEO_DEFAULT_API_URL || 'https://api.veo.example/veo',
formsApiUrl: process.env.VEO_FORMS_API_URL || 'https://api.veo.example/forms',
historyApiUrl: process.env.VEO_HISTORY_API_URL || 'https://api.veo.example/history',
reportsApiUrl: process.env.VEO_REPORTING_API_URL || 'https://api.veo.example/reporting',
accountsApiUrl: process.env.VEO_ACCOUNTS_API_URL || 'https://api.veo.example/accounts',
oidcUrl: process.env.VEO_OIDC_URL || 'https://auth.veo.example/auth',
oidcAccountApplication:
process.env.VEO_OIDC_ACCOUNT_APPLICATION ||
'https://auth.veo.example/auth/realms/veo-oidcrealm-example/account',
oidcRealm: process.env.VEO_OIDC_REALM || 'veo-oidcrealm-example',
oidcClient: process.env.VEO_OIDC_CLIENT || 'veo-oidcclient-example',
accountPath: process.env.VEO_ACCOUNT_PATH || 'https://account.veo.example',
debug: process.env.VEO_DEBUG || 'false',
debugCache: process.env.VEO_DEBUG_CACHE || 'false', // Either a boolean or the query string (or first entry of query string if array)
securityPolicyInvalidationDate:
process.env.VEO_SECURITY_POLICY_INVALIDATION_DATE_TIMESTAMP ?
new Date(parseInt(process.env.VEO_SECURITY_POLICY_INVALIDATION_DATE_TIMESTAMP))
: new Date(new Date().getFullYear() + 1, 0, 1),
documentationUrl: process.env.VEO_DOCUMENTATION_URL || 'veo-documentation-url-example'
}
},
// Modules are buildtime only. Can be used to modify build behaviour
modules: [
DocsModule as any,
'@nuxt/content',
'@nuxtjs/i18n',
'./modules/vuetify-sass-variables.ts',
'nuxt-font-loader'
],
build: {
transpile: ['vuetify', 'hast-util-to-string', 'micromark']
},
vite: {
plugins: vitePlugins,
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/assets/styles/global.scss";'
}
}
}
},
//==============================================================
// Plugin configuration
//==============================================================
// Nuxt content configuration
content: {
sources: {
// overwrite default source AKA `content` directory
content: {
driver: 'fs',
base: resolve(__dirname, 'docs')
}
},
experimental: {
clientDB: true
},
locales: LOCALES.map((locale) => locale.code),
defaultLocale: 'de',
// @ts-ignore TODO #3066 does not exist
toc: {
depth: 5
}
},
// i18n configuration
i18n: {
strategy: 'no_prefix',
locales: LOCALES,
defaultLocale: 'de',
lazy: true,
langDir: '../locales/base/'
},
fontLoader: {
local: [
{
src: '/Roboto-Regular.ttf',
family: 'Roboto'
},
{
src: '/OpenSans-Regular.ttf',
family: 'Open Sans'
}
]
}
});