-
Notifications
You must be signed in to change notification settings - Fork 9
/
nuxt.config.ts
81 lines (79 loc) · 1.67 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
import devConfig from "./config/dev.config";
import prodConfig from "./config/prod.config";
import enUS from "./locales/en-US";
import frFR from "./locales/fr-FR";
const isProd = process.env.VERCEL_ENV === "production";
const baseUrl = isProd
? "https://nuxt3-template-jsulpis.vercel.app"
: `https://${process.env.VERCEL_URL || "localhost:3000"}`;
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
appConfig: isProd ? prodConfig : devConfig,
srcDir: "src",
css: ["@unocss/reset/tailwind.css", "@/styles/main.scss"],
modules: [
"@vueuse/nuxt",
"@nuxtjs/i18n",
"@pinia/nuxt",
"nuxt-icon",
"@nuxtjs/robots",
"nuxt-simple-sitemap",
"@nuxtjs/plausible"
],
runtimeConfig: {
public: {
baseUrl
}
},
experimental: {
inlineSSRStyles: false // avoid duplicating the styles (inline + external css files)
},
robots: {
rules: {
Sitemap: `${baseUrl}/sitemap.xml`
}
},
sitemap: {
hostname: baseUrl,
urls: () => ["/dynamic-page", "/fr/page-dynamique"]
},
plausible: {
apiHost: baseUrl
},
i18n: {
baseUrl,
locales: [
{ code: "fr", iso: "fr-FR", name: "Français" },
{ code: "en", iso: "en-US", name: "English" }
],
defaultLocale: "en",
detectBrowserLanguage: {
useCookie: true
},
vueI18n: {
legacy: false,
locale: "en",
messages: {
en: enUS,
fr: frFR
}
}
},
nitro: {
handlers: process.env.MOCK
? [{ route: "", handler: "./__mocks__/mocks.handlers" }]
: undefined,
prerender: {
routes: ["/", "/fr", "/get-started", "/fr/demarrage"]
}
},
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "src/styles/abstract" as *;'
}
}
}
}
});