forked from acdh-oeaw/openatlas-discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
124 lines (120 loc) · 2.97 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
import { fileURLToPath } from "node:url";
import { defaultLocale, localesMap } from "./config/i18n.config";
import { getGitInfo } from "./utils/get-git-info";
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const baseUrl = process.env.NUXT_PUBLIC_APP_BASE_URL!;
const { branchName, commitHash, tag } = getGitInfo();
export default defineNuxtConfig({
alias: {
"@": fileURLToPath(new URL("./", import.meta.url)),
},
app: {
layoutTransition: false,
pageTransition: false,
},
colorMode: {
classSuffix: "",
dataValue: "ui-color-scheme",
},
components: [{ path: "@/components", extensions: [".vue"], pathPrefix: false }],
content: {
defaultLocale,
locales: Object.keys(localesMap),
},
css: ["@fontsource-variable/inter/slnt.css", "tailwindcss/tailwind.css", "@/styles/index.css"],
devtools: {
enabled: true,
},
experimental: {
componentIslands: {
selectiveClient: true,
},
defaults: {
useAsyncData: {
deep: false,
},
useFetch: {
timeout: 250,
},
},
inlineRouteRules: true,
},
features: {
/** @see https://github.com/nuxt/nuxt/issues/21821 */
inlineStyles: false,
},
future: {
compatibilityVersion: 4,
},
/**
* FIXME: some dependency does not properly clean up,
* so the build hangs without this workaround.
*
* @see https://github.com/nuxt/cli/issues/169
*/
hooks: {
close(nuxt) {
if (!nuxt.options._prepare) {
process.exit();
}
},
},
i18n: {
baseUrl,
defaultLocale,
detectBrowserLanguage: {
redirectOn: "root",
},
langDir: "./messages",
lazy: true,
locales: Object.values(localesMap),
strategy: "prefix_except_default",
vueI18n: "./i18n.config.ts",
},
imports: {
dirs: ["./config/"],
},
modules: ["@nuxt/content", "@nuxt/image", "@nuxtjs/color-mode", "@nuxtjs/i18n", "@vueuse/nuxt"],
nitro: {
compressPublicAssets: true,
prerender: {
routes: ["/manifest.webmanifest", "/robots.txt", "/sitemap.xml"],
},
},
postcss: {
plugins: {
tailwindcss: {},
},
},
runtimeConfig: {
public: {
apiBaseUrl: process.env.NUXT_PUBLIC_API_BASE_URL,
appBaseUrl: process.env.NUXT_PUBLIC_APP_BASE_URL,
bots: process.env.NUXT_PUBLIC_BOTS,
database: process.env.NUXT_PUBLIC_DATABASE,
gitBranchName: branchName,
gitCommitHash: commitHash,
gitTag: tag,
googleSiteVerification: process.env.NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION,
mapBaselayerUrlDark: process.env.NUXT_PUBLIC_MAP_BASELAYER_URL_DARK,
mapBaselayerUrlLight: process.env.NUXT_PUBLIC_MAP_BASELAYER_URL_LIGHT,
matomoBaseUrl: process.env.NUXT_PUBLIC_MATOMO_BASE_URL,
matomoId: process.env.NUXT_PUBLIC_MATOMO_ID,
openapiBaseUrl: process.env.NUXT_PUBLIC_OPENAPI_BASE_URL,
redmineId: process.env.NUXT_PUBLIC_REDMINE_ID,
specialImprint: process.env.NUXT_PUBLIC_SPECIAL_IMPRINT,
},
},
typescript: {
shim: false,
strict: true,
// https://github.com/nuxt/nuxt/issues/14816#issuecomment-1484918081
tsConfig: {
compilerOptions: {
paths: {
"@/*": ["./*"],
},
},
},
},
});