-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
117 lines (115 loc) · 3.88 KB
/
Copy pathnuxt.config.ts
File metadata and controls
117 lines (115 loc) · 3.88 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
import { defineNuxtConfig } from "nuxt/config";
import { fileURLToPath } from "node:url";
const zzzuiPackages = fileURLToPath(new URL("./zzzui/packages", import.meta.url));
const zzzuiSrc = fileURLToPath(new URL("./zzzui/src", import.meta.url));
export default defineNuxtConfig({
compatibilityDate: "2025-07-01",
srcDir: "app/",
modules: ["@pinia/nuxt"],
ssr: false,
nitro: {
preset: "static",
},
css: ["~/assets/styles/theme.css"],
runtimeConfig: {
public: {
// 本地 dev 或 Pages 預覽構建可通過 .env 的 NUXT_PUBLIC_API_BASE_URL 指定後端地址。
apiBaseUrl: process.env.NUXT_PUBLIC_API_BASE_URL || "",
appName: "绳网",
},
},
app: {
head: {
title: "绳网",
link: [
// 使用 200×200 的品牌图标,避免搜索引擎和浏览器将 16×16 小图标判定为不可用。
{ rel: "icon", type: "image/png", sizes: "200x200", href: "/images/zzzicon_200x200.png" },
{ rel: "apple-touch-icon", sizes: "200x200", href: "/images/zzzicon_200x200.png" },
// 首屏关键图片预加载:SPA loading 屏的 GIF 与首页底图 main.avif
// 目的:避免生产环境下 JS 挂载早于 GIF 解码导致 loading 屏一闪而过,
// 以及 #__nuxt::before 背景图未就绪出现的"黑屏"过渡。
{ rel: "preload", as: "image", href: "/images/loading.gif", fetchpriority: "high" },
{ rel: "preload", as: "image", href: "/images/main.avif", fetchpriority: "high" },
{ rel: "preconnect", href: "https://im.tiwat.cn" },
],
htmlAttrs: {
lang: "zh-CN",
},
meta: [
{ charset: "utf-8" },
{
name: "viewport",
content: "width=device-width, initial-scale=1, viewport-fit=cover",
},
{ name: "color-scheme", content: "dark" },
{ name: "theme-color", content: "#000000" },
{ name: "application-name", content: "绳网" },
{ name: "description", content: "新艾利都最大的匿名委托中枢。" },
{ property: "og:type", content: "website" },
{ property: "og:site_name", content: "绳网" },
{ property: "og:title", content: "绳网" },
{ property: "og:description", content: "新艾利都最大的匿名委托中枢。" },
{ property: "og:image", content: "/images/zzzicon_200x200.png" },
{ name: "twitter:card", content: "summary_large_image" },
],
script: [
{
type: "application/ld+json",
innerHTML: JSON.stringify({
"@context": "https://schema.org",
"@type": "WebSite",
name: "绳网",
alternateName: "INTER-KNOT",
description: "新艾利都最大的匿名委托中枢。",
url: "https://interk.net/",
}),
},
// Cloudflare Web Analytics
{
src: "https://static.cloudflareinsights.com/beacon.min.js",
defer: true,
"data-cf-beacon": '{"token": "87a21c330b51466ca19ec0b32ff89a51"}',
},
],
},
},
typescript: {
strict: true,
typeCheck: true,
},
sourcemap: {
client: true,
},
vite: {
optimizeDeps: {
include: [
'@tanstack/vue-query',
'throttle-debounce',
'@vueuse/core',
'@heroicons/vue/24/outline',
'@heroicons/vue/24/solid',
'vue-advanced-cropper',
'isomorphic-dompurify',
'markdown-it',
'lightgallery',
'lightgallery/plugins/zoom',
'lightgallery/plugins/thumbnail',
'lightgallery/plugins/fullscreen',
],
},
resolve: {
alias: {
"zenless-ui": zzzuiPackages,
"@src": zzzuiSrc,
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import 'zenless-ui/theme/var.scss';\n`,
silenceDeprecations: ['import', 'global-builtin'],
},
},
},
},
});