-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
141 lines (139 loc) · 4 KB
/
nuxt.config.ts
File metadata and controls
141 lines (139 loc) · 4 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
import content from '@originjs/vite-plugin-content'
export default defineNuxtConfig({
vue: {
compilerOptions: {},
},
compatibilityDate: 'latest',
devServer: {
host: '127.0.0.1',
port: 3000,
},
site: {
url: 'https://mscpo.crashvibe.cn',
name: 'Minecraft集体宣传组织(MSCPO)',
description:
'Minecraft集体宣传组织(MSCPO) - 专业的Minecraft服务器宣传与技术交流平台,提供最新服务器资讯、开服教程和集体宣传片',
defaultLocale: 'zh-cn',
cacheMaxAgeSeconds: 24 * 3600,
autoLastmod: true,
indexable: true,
},
experimental: {
buildCache: true,
asyncEntry: true,
writeEarlyHints: true,
payloadExtraction: true,
componentIslands: true,
},
nitro: {
static: true,
compressPublicAssets: {
gzip: true,
brotli: true,
},
prerender: {
crawlLinks: true,
routes: ['/robots.txt', '/sitemap.xml'],
failOnError: false,
},
esbuild: {
options: {
target: 'esnext',
minify: true,
},
},
minify: true,
},
build: {
analyze: {
analyzerMode: 'static',
openAnalyzer: false,
},
transpile: ['ant-design-vue'],
},
features: {
inlineStyles: true,
},
app: {
head: {
title: 'Minecraft集体宣传组织(MSCPO)',
titleTemplate: '%s | MSCPO',
viewport:
'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0',
meta: [
{ charset: 'utf-8' },
{
name: 'keywords',
content:
'Minecraft服务器,MC服务器宣传,我的世界技术交流,集体宣传片,开服教程',
},
{
property: 'og:title',
content:
'Minecraft集体宣传组织(MSCPO) - 服务器宣传与技术交流平台',
},
{ property: 'og:type', content: 'website' },
],
link: [{ rel: 'icon', href: '/logo.webp', sizes: 'any' }],
script: [
{
src: 'https://umami.crashvibe.cn/script.js',
defer: true,
'data-domains': 'mscpo.crashvibe.cn,mscpo.1fu.top',
'data-website-id': '73146bad-70d1-47e1-bfe4-9f2b4a9af4c8',
},
],
},
pageTransition: {
name: 'page',
mode: 'in-out',
},
},
vite: {
plugins: [content()],
build: {
minify: 'terser',
cssCodeSplit: true, // CSS 代码分割
chunkSizeWarningLimit: 1500, // 提高 chunk 大小限制
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log'], // 移除所有 console.log
},
format: {
comments: false, // 移除注释
},
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true, // Ant Design 需要
},
},
},
},
devtools: {
enabled: true,
},
modules: [
'@nuxtjs/seo',
'@ant-design-vue/nuxt',
'@hypernym/nuxt-anime',
'@nuxt/content',
'@nuxtjs/critters',
'nuxt-link-checker',
],
antd: {
extractStyle: true,
},
ssr: true,
runtimeConfig: {
public: {
commitHash: process.env.NUXT_PUBLIC_COMMIT_HASH || undefined,
api_backend_url:
process.env.API_BACKEND_URL || 'https://mscpoapi.crashvibe.cn/',
},
},
})