-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
100 lines (100 loc) · 2 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
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
runtimeConfig: {
version: "0.0.1",
session: {
name: "blog-session",
password: "",
// cookie:{
// // https://57code.gitee.io/nuxt3-docs-zh/usage/cookies.html#httponly
// secure: false
// }
},
},
// typescript: {
// shim: false
// },
modules: [
"nuxt-icon",
"@pinia/nuxt",
'@pinia-plugin-persistedstate/nuxt',
"@nuxtjs/tailwindcss",
"@nuxtjs/color-mode",
"@nuxtjs/i18n",
],
imports: {
dirs: ["./stores"],
},
// 做成静态站点需要将动态路由静态化
// https://nuxt.com/docs/api/configuration/nuxt-config#generate
// nitro: {
// prerender: {
// routes: ["/article/20"],
// },
// },
experimental: {
payloadExtraction: false,
},
css: ["~/assets/css/main.css", "skeleton-elements/css"],
i18n: {
strategy: "prefix_except_default",
defaultLocale: "zh",
dynamicRouteParams: true,
detectBrowserLanguage: {
useCookie: true,
},
// lazy: true,
compilation: {
strictMessage: false,
escapeHtml: true,
},
langDir: "locales",
locales: [
{
code: "en",
iso: "en-US",
file: "en.json",
name: "English",
},
{
code: "zh",
iso: "zh-EN",
file: "zh.json",
name: "Chinese",
},
],
},
colorMode: {
preference: "winter", // default theme
dataValue: "theme", // activate data-theme in <html> tag
classSuffix: "",
},
devtools: { enabled: true },
typescript: {
shim: false,
strict: true,
},
app: {
pageTransition: { name: 'page', mode: 'out-in' },
layoutTransition: { name: 'layout', mode: 'out-in' },
rootId: "__blog",
buildAssetsDir: "static",
head: {
meta: [
{ name: 'keywords', content: '前端, keywords' },
{ name: 'description', content: '博客' }
],
title: "棉木之屋",
// https://github.com/nuxt/nuxt/discussions/16109
script: [{ children: 'console.log("HELLO NUXT3");' }],
},
},
nitro: {
storage: {
data: {
driver: 'fs',
base: './.data/kv'
}
}
}
});