-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
171 lines (170 loc) · 4.79 KB
/
Copy pathnuxt.config.ts
File metadata and controls
171 lines (170 loc) · 4.79 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
162
163
164
165
166
167
168
169
170
171
import { randomBytes } from 'node:crypto'
import process from 'node:process'
import tailwindcss from '@tailwindcss/vite'
import { currentLocales } from './i18n/i18n'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
modules: [
'@nuxtjs/color-mode',
'@nuxtjs/i18n',
'@nuxt/eslint',
'@pinia/nuxt',
'shadcn-nuxt',
],
devtools: { enabled: true },
css: ['@/assets/css/tailwind.css'],
colorMode: {
classSuffix: '',
},
runtimeConfig: {
siteToken: process.env.NUXT_SITE_TOKEN || randomBytes(32).toString('base64url'),
cfAccessTeamDomain: '',
cfAccessAud: '',
redirectStatusCode: '301',
linkCacheTtl: 60,
redirectWithQuery: false,
redirectNoStore: false,
homeURL: '',
cfAccountId: '',
cfApiToken: '',
dataset: 'sink',
aiModel: '@cf/qwen/qwen3-30b-a3b-fp8',
aiPrompt: `You are a URL shortening assistant, please shorten the URL provided by the user into a SLUG. The SLUG information should be derived from the URL and page content (if provided). Do not make any assumptions beyond the given information. A SLUG is human-readable and should not exceed three words and can be validated using regular expressions {slugRegex} . Only the best one is returned, the format must be JSON reference {"slug": "example-slug"}`,
aiOgPrompt: `You are an OpenGraph metadata assistant. Please summarize the page content provided by the user into a perfect title and description for an OpenGraph preview. Do not make any assumptions beyond the given information. Only the best one is returned, the format must be JSON reference {"title": "Example Title", "description": "Example description that summarizes the page accurately."}`,
caseSensitive: false,
importRequestLimit: 100,
listQueryLimit: 500,
disableBotAccessLog: false,
disableAutoBackup: false,
notFoundRedirect: '',
safeBrowsingDoh: '', // Set to DoH URL to enable auto-detection, e.g. https://family.cloudflare-dns.com/dns-query
webhookUrl: '',
webhookSecret: '',
public: {
previewMode: '',
slugDefaultLength: '6',
kvBatchLimit: '50',
},
},
routeRules: {
'/dashboard': {
redirect: '/dashboard/links',
},
'/api/**': {
cors: process.env.NUXT_API_CORS === 'true',
},
'/_docs/**': {
headers: { 'X-Robots-Tag': 'noindex, follow' },
},
'/sphere.bin': {
headers: { 'Cache-Control': 'public, max-age=0, must-revalidate' },
},
'/*.json': {
headers: { 'Cache-Control': 'public, max-age=2592000, immutable' },
},
'/*.geojson': {
headers: { 'Cache-Control': 'public, max-age=2592000, immutable' },
},
},
experimental: {
enforceModuleCompatibility: true,
},
typescript: {
tsConfig: {
compilerOptions: {
types: ['vite/client'],
},
},
},
compatibilityDate: '2026-07-13',
nitro: {
preset: import.meta.env.CF_PAGES !== '1' ? 'cloudflare-module' : undefined,
experimental: {
openAPI: true,
},
timing: true,
openAPI: {
production: 'runtime',
meta: {
title: 'Sink API',
description: 'A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.\n\n[Return to this Sink instance](/) · [Read the documentation](https://docs.sink.cool)',
},
route: '/_docs/openapi.json',
ui: {
scalar: {
route: '/_docs/scalar',
},
swagger: {
route: '/_docs/swagger',
},
},
},
},
vite: {
plugins: [
tailwindcss(),
],
worker: {
format: 'es',
},
optimizeDeps: {
include: [
'@internationalized/date',
'@lucide/vue',
'@number-flow/vue',
'@tanstack/vue-form',
'@unovis/vue',
'@vue/devtools-core',
'@vue/devtools-kit',
'@vueuse/core',
'class-variance-authority',
'clsx',
'd3-geo',
'd3-scale',
'nanoid',
'qr-code-styling', // CJS
'reka-ui',
'reka-ui/date',
'tailwind-merge',
'twgl.js',
'vaul-vue',
'virtua/vue',
'vue-sonner',
'vue3-simple-icons',
'zod',
],
},
},
eslint: {
config: {
standalone: false,
},
},
i18n: {
locales: currentLocales,
compilation: {
strictMessage: false,
escapeHtml: true,
},
strategy: 'no_prefix',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'sink_i18n_redirected',
redirectOn: 'root',
},
baseUrl: '/',
defaultLocale: 'en-US',
},
shadcn: {
/**
* Prefix for all the imported component
*/
prefix: '',
/**
* Directory that the component lives in.
* @default "./components/ui"
*/
componentDir: './app/components/ui',
},
})