-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
161 lines (143 loc) · 3.76 KB
/
Copy pathnuxt.config.ts
File metadata and controls
161 lines (143 loc) · 3.76 KB
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
// import { pwa } from "./config/pwa";
import dayjs from "dayjs";
import { themeOverridesShared } from "./config/theme";
export default defineNuxtConfig({
modules: [
"@bg-dev/nuxt-naiveui",
"@vueuse/nuxt",
"@unocss/nuxt",
"@pinia/nuxt",
"@nuxtjs/color-mode",
// "@vite-pwa/nuxt",
"@nuxt/eslint",
"@nuxtjs/i18n",
"nuxt-echarts",
],
runtimeConfig: {
public: {
needRedirect: false,
updateTime: dayjs().add(new Date().getTimezoneOffset() + 480, "minutes").format("YYYY-MM-DD HH:mm:ss"),
},
},
routeRules: {
"/**": { prerender: true },
"/deck/**": { ssr: false, prerender: false },
"/en/deck/**": { ssr: false, prerender: false },
"/player/**": { ssr: false, prerender: false },
"/en/player/**": { ssr: false, prerender: false },
"/admin/**": { ssr: false, prerender: false },
"/en/admin/**": { ssr: false, prerender: false },
},
typescript: {
tsConfig: {
compilerOptions: {
noUncheckedIndexedAccess: false,
},
},
},
nitro: {
// devStorage: {
// cache: {
// driver: "memory",
// },
// },
// static: true,
esbuild: {
options: {
target: "esnext",
},
},
prerender: {
crawlLinks: true,
ignore: ["/admin"],
failOnError: true,
},
serverAssets: [{
baseName: "data",
dir: "./data",
}],
openAPI: {
meta: {
title: "召唤之巅API",
},
production: "runtime",
route: "/_docs/openapi.json",
ui: {
scalar: {
route: "/_docs/scalar",
theme: "bluePlanet",
},
swagger: {
route: "/_docs/swagger",
},
},
},
experimental: {
openAPI: true,
},
},
app: {
head: {
viewport: "width=device-width,initial-scale=1",
link: [
{ rel: "icon", type: "image/svg+xml", href: `${process.env.NUXT_APP_BASE_URL ?? "/"}favicon.svg` },
{ rel: "apple-touch-icon", href: `${process.env.NUXT_APP_BASE_URL ?? "/"}apple-touch-icon.png` },
],
meta: [
{ name: "viewport", content: "width=device-width, initial-scale=1" },
// { name: "description", content: "七圣召唤赛事资料" },
{ name: "apple-mobile-web-app-status-bar-style", content: "black-translucent" },
{ name: "theme-color", media: "(prefers-color-scheme: light)", content: "white" },
{ name: "theme-color", media: "(prefers-color-scheme: dark)", content: "#222222" },
],
script: [
{ textContent: "var sc_project=12936927; var sc_invisible=1; var sc_security=\"22ea8aae\";" },
{ async: true, src: "https://www.statcounter.com/counter/counter.js" },
],
},
layoutTransition: { name: "layout-transition", mode: "out-in" },
pageTransition: { name: "layout-transition", mode: "out-in" },
},
experimental: {
typedPages: true,
},
components: [
{ path: "~/components" },
{ path: "~/components/main", pathPrefix: false },
],
css: [
"@unocss/reset/tailwind.css",
],
naiveui: {
themeConfig: {
shared: themeOverridesShared,
},
},
// colorMode: {
// classSuffix: "",
// },
// pwa,
devtools: {
enabled: false,
},
eslint: {
config: {
standalone: false,
},
},
i18n: {
strategy: "prefix_except_default",
defaultLocale: "zh",
locales: [
{ code: "zh", language: "zh-CN", name: "简体中文", isCatchallLocale: true },
{ code: "en", language: "en-US", name: "English" },
],
restructureDir: "locales",
},
echarts: {
renderer: "svg",
charts: ["BarChart", "LineChart"],
components: ["GridComponent", "TooltipComponent", "LegendComponent", "DataZoomComponent"],
},
compatibilityDate: "2024-07-03",
});