-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnuxt.config.ts
116 lines (103 loc) · 2.46 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
import tags from "./dataset/tags.json";
import words from "./dataset/words.json";
const isLocal = !process.env.SERVER_ENV || process.env.SERVER_ENV === "local";
export default defineNuxtConfig({
compatibilityDate: "2024-07-31",
ssr: true, // Enable prerender
components: true,
nitro: {
prerender: {
autoSubfolderIndex: false,
},
},
typescript: {
strict: true,
tsConfig: {
compilerOptions: {
allowImportingTsExtensions: true,
checkJs: true,
newLine: "lf",
removeComments: true,
declaration: false,
types: [
"@cloudflare/workers-types/2023-07-01",
],
},
// Relative paths are based on .nuxt/tsconfig.json.
// ../ means project root.
exclude: [
// Dataset from genshin-langdata
"../dataset/**",
"../public/dataset/**",
// Cloudflare
"../.wrangler/**",
"../functions/**",
],
},
},
css: [ "~/assets/styles/global.scss" ],
runtimeConfig: {
public: {
serverEnv: process.env.SERVER_ENV,
},
},
modules: [
"@nuxtjs/i18n",
"@nuxtjs/robots",
"@nuxtjs/sitemap",
"@pinia/nuxt",
...(isLocal ? [ "@nuxt/devtools" ] : []),
],
i18n: {
locales: [
{
code: "en",
language: "en",
name: "English",
},
{
code: "ja",
language: "ja-JP",
name: "日本語",
},
{
code: "zh-CN",
language: "zh-CN",
name: "简体中文",
},
],
strategy: "prefix",
baseUrl: "https://genshin-dictionary.com",
detectBrowserLanguage: false,
vueI18n: "i18n.config.ts"
},
sitemap: {
autoLastmod: false,
cacheTtl: 0, // disable cache
urls: [
...([ "en", "ja" , "zh-CN" ].map(lang => [
{ loc: `/${lang}` },
{ loc: `/${lang}/history` },
...(words.map(word => ({ loc: `/${lang}/${word.id}`, lastmod: word.updatedAt }))),
...(Object.keys(tags).map(tagID => ({ loc: `/${lang}/tags/${tagID}` }))),
]).flat()),
// Pages not translated yet
{ loc: "/ja/about" },
{ loc: "/ja/opendata" },
],
exclude: [
"/en/about",
"/en/opendata",
"/zh-CN/about",
"/zh-CN/opendata",
],
},
devtools: {
enabled: isLocal,
},
// For nuxt-simple-robots and nuxt-simple-sitemap
site: {
url: "https://genshin-dictionary.com",
indexable: process.env.SERVER_ENV === "production",
},
});