-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
140 lines (122 loc) · 3.25 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import config from './config'
import vueJsx from '@vitejs/plugin-vue-jsx';
export default defineNuxtConfig({
ssr: false,
// ssr:true,
nitro: {
prerender: {
routes:[
'/download'
],
crawlLinks: true, // 让 Nuxt 自动爬取所有可访问的页面
}
},
vite: {
plugins: [vueJsx(),], // 加载 Vue JSX 插件
},
typescript: {
shim: false, // 禁用 shim,提高类型推断能力
},
app: {
pageTransition: { name: 'page', mode: 'out-in' },
head: {
title: `${config.brandName} - ${config.tagline}`,
meta: [
{ charset: 'utf-8' },
{ hid: 'description', name: 'description', content: config.metaDescription },
{ hid: 'keywords', name: 'keywords', content: config.metaKeywords },
{
name: "viewport",
content: "width=device-width, initial-scale=1.0, user-scalable=no"
}
],
htmlAttrs: {
lang: 'en',
},
link: [
{ rel: 'icon', type: 'image/x-icon', href: config.favicon },
],
script: [
{
src: '/fullpage.js',
type: 'text/javascript',
defer: true,
},
{
src: '/lib/particles/particles.js',
type: 'text/javascript',
defer: true,
}
]
}
},
runtimeConfig: {
public: {
appEnv: process.env.NODE_ENV || 'development',
baseURL: process.env.BASE_URL || 'https://1s.design:4321',
apiURL: process.env.API_URL || config.apiURL,
apiKey: process.env.API_KEY || config.apiKey,
},
},
devtools: { enabled: true },
css: ['~/public/fullpage.css', '~/assets/main.scss', '~/assets/md.scss', 'animate.css/animate.min.css', 'v-calendar/dist/style.css', 'vue-data-ui/style.css', 'cal-heatmap/cal-heatmap.css',],
build: {
transpile: ['element-plus'], // 确保正确编译 Element Plus
},
modules: [
'@nuxt/ui',
'@nuxtjs/sitemap',
"@nuxt/image",
'@ant-design-vue/nuxt',
"@stefanobartoletti/nuxt-social-share",
'@pinia/nuxt',
'nuxt-paypal',
'@nuxtjs/i18n',
'@nuxt/content',
'nuxt-paypal',
'@nuxtjs/color-mode',
'nuxt-echarts',
'@samk-dev/nuxt-vcalendar',
],
// gtm: {
// id: config.gtmID,
// defer: false,
// },
site: {
url: process.env.BASE_URL || 'http://localhost:1234',
},
sitemap: {
cacheMaxAgeSeconds: 60 * 60 * 24,
xsl: false,
sitemaps: true,
autoLastmod: true,
sources: [
'/api/__sitemap__/urls',
],
},
i18n: {
lazy: true, // Enable lazy loading
strategy: 'no_prefix', // URL strategy
vueI18n: './i18n.config.ts', // Path to Vue I18n configuration
locales: ["en", "zh"], //配置语种
},
paypal: {
clientId: 'AdOWq5VdofoxJKPNX7U7SMKF-pdRrzjbZ5aftu_peFlDFsSx-m2BpO8_tkSCngK3hHTOvYyQq_0mm73T',
// ...options
},
colorMode: {
preference: 'system', // default value of $colorMode.preference
// fallback: 'light', // fallback value if not system preference found
hid: 'nuxt-color-mode-script',
globalName: '__NUXT_COLOR_MODE__',
componentName: 'ColorScheme',
classPrefix: '',
classSuffix: '-mode',
storageKey: 'nuxt-color-mode'
},
devServer: {
https: true,
host: 'localhost',
},
compatibilityDate: '2025-02-22',
})