-
Notifications
You must be signed in to change notification settings - Fork 11
/
nuxt.config.ts
340 lines (310 loc) · 8.63 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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
import { fileURLToPath, URL } from 'node:url'
import { resolve } from 'pathe'
import { addComponent } from 'nuxt/kit'
import presetIcons from '@unocss/preset-icons'
import { bundledLanguages } from 'shiki'
import site from './site'
const {
name,
description,
url,
defaultLocale,
identity,
twitter,
trailingSlash,
titleSeparator,
} = site
export default defineNuxtConfig({
extends: [
'./app-nuxtui-layer', // NavBar and Footer components
],
// ssr: false,
// devtools: { enabled: false }, // enabled by default, disable when using standalone Vue devtools
// Preparation for Nuxt 4 migration
future: {
compatibilityVersion: 4,
},
// Before Nuxt 4 migration
// srcDir: 'app',
// serverDir: fileURLToPath(new URL('server', import.meta.url)),
// dir: {
// public: fileURLToPath(new URL('public', import.meta.url)),
// modules: fileURLToPath(new URL('modules', import.meta.url)),
// },
experimental: {
componentIslands: true,
},
// nitro: {
// preset: 'netlify-static',
// },
app: {
baseURL: '/', // defaulted by nuxt
// Look into HeadAndMeta.vue for the rest
head: {
meta: [{ charset: 'utf-8' }], // defaulted by nuxt
},
},
modules: [
'@pinegrow/nuxt-module',
'@unocss/nuxt',
'@nuxt/content',
'@vueuse/nuxt',
'@pinia/nuxt',
// '@nuxtjs/html-validator',
'@nuxt/image',
'@vee-validate/nuxt',
'@nuxtjs/seo',
// '@nuxtjs/fontaine', // blocked by https://github.com/nuxt-modules/fontaine/issues/342
'@nuxtjs/critters',
// '@nuxt/icon', // Pre-included by @nuxt/ui
'@nuxt/eslint',
'@nuxt/ui',
function () {
addComponent({
name: 'UIcon',
filePath: '@/components/BaseIcon.vue',
priority: 100,
})
},
],
colorMode: {
preference: 'light',
},
ui: {
// safelistColors: [
// 'primary',
// 'secondary',
// 'tertiary',
// 'success',
// 'warning',
// 'error',
// 'info',
// ],
},
// https://dev.to/jacobandrewsky/improving-performance-of-nuxt-with-fontaine-5dim
// blocked by https://github.com/nuxt-modules/fontaine/issues/342
// fontMetrics: {
// fonts: ['Inter', 'Kalam'],
// },
// https://dev.to/jacobandrewsky/optimizing-css-performance-in-nuxt-with-critters-4k8i
critters: {
// Options passed directly to critters: https://github.com/GoogleChromeLabs/critters#critters-2
config: {
// Default: 'media'
preload: 'swap',
},
},
icon: {
componentName: 'NuxtIcon', // Instead of NuxtIcon, prefer using UIcon. Nuxt UI's UIcon is overridden with a local component `BaseIcon` that uses UnoCSS Preset-Icons which allows us to use any icons from the iconify iconsets and is very efficient in terms of automatic treeshaking.
serverBundle: {
collections: ['heroicons'],
},
},
// Global styles
css: [
'@/assets/css/tailwind.css',
'lite-youtube-embed/src/lite-yt-embed.css',
],
postcss: {
plugins: {
'tailwindcss/nesting': {},
tailwindcss: {},
autoprefixer: {},
},
},
image: {
// dir: 'assets/images', // doesn't always work, for eg, with vercel etc, https://github.com/nuxt/image/issues/1006. Therefore, we are storing the images in public folder, to have them not processed by vite, but rather by nuxt-image module on-demand
// sizes: 'xs:100vw sm:100vw md:100vw lg:100vw xl:100vw', // Global sizes not yet supported, has to be specified in NuxtImg or NuxtPicture tags - https://github.com/nuxt/image/issues/216
// densities: [1,2], // default
// quality: 80, // can be overridden as NuxtImg prop
format: ['webp, png, jpg'], // default is ['webp']
// The screen sizes predefined by `@nuxt/image`:
// screens: {
// xs: 320,
// sm: 640,
// md: 768,
// lg: 1024,
// xl: 1280,
// xxl: 1536,
// '2xl': 1536,
// },
// TODO: Currently image optimization is paused until some bugs in Nuxt Image modules are fixed
// provider: 'ipx',
provider: 'none',
presets: {
avatar: {
modifiers: {
format: 'webp',
width: 80,
height: 80,
},
},
},
// netlify: {
// baseURL: url,
// },
domains: [
'images.unsplash.com',
'fakestoreapi.com',
'res.cloudinary.com',
'avatars.githubusercontent.com',
'gravatar.com',
],
alias: {
unsplash: 'https://images.unsplash.com',
},
},
veeValidate: {
// disable or enable auto imports
autoImports: true,
// Use different names for components
componentNames: {
Form: 'VeeForm',
Field: 'VeeField',
FieldArray: 'VeeFieldArray',
ErrorMessage: 'VeeErrorMessage',
},
},
content: {
// Before Nuxt 4 migration
sources: {
content: {
driver: 'fs',
base: resolve(__dirname, 'app/content'),
},
},
markdown: {
anchorLinks: false,
rehypePlugins: [
[
'rehype-external-links',
{
target: '_blank',
rel: ['noopener'],
test: (node: any) => /^https?:\/\//.test(node.properties.href),
},
],
],
},
highlight: {
//@ts-ignore
langs: Object.keys(bundledLanguages),
theme: 'dracula-soft',
},
},
pinia: {
storesDirs: ['./stores/**'],
},
imports: {
// dirs: ['my-components'],
},
vue: {
compilerOptions: {
isCustomElement: (tag) => tag === 'lite-youtube',
},
},
sourcemap: {
client: false,
server: false,
},
routeRules: {
'/hidden': { robots: false },
},
// Used by all modules in the @nuxtjs/seo collection
// https://nuxtseo.com/nuxt-seo/guides/configuring-modules
site: {
url,
name,
description,
defaultLocale,
// https://nuxtseo.com/nuxt-seo/guides/setting-an-identity
identity,
twitter,
trailingSlash,
titleSeparator,
},
robots: {
// https://nuxtseo.com/robots/api/config#blocknonseobots
blockNonSeoBots: true,
},
sitemap: {
// https://nuxtseo.com/sitemap/guides/i18n#debugging-hreflang
// Open {{site.url}}/sitemap.xml
xslColumns: [
{ label: 'URL', width: '50%' },
{ label: 'Last Modified', select: 'sitemap:lastmod', width: '12.5%' },
{ label: 'Priority', select: 'sitemap:priority', width: '12.5%' },
{
label: 'Change Frequency',
select: 'sitemap:changefreq',
width: '12.5%',
},
{ label: 'Hreflangs', select: 'count(xhtml:link)', width: '12.5%' },
],
// To turn off xls file when viewing sitemap.xml
// xsl: false,
// Remove strictNuxtContentPaths if using nuxt-content in documentDriven mode
strictNuxtContentPaths: true,
},
ogImage: {
// OG images and nuxtseo features can be previewed with nuxt-devtools during development. OG images can also be viewed using URL in this form - `/__og-image__/image/<path>/og.<extension>. For eg, {{site.url}}/__og-image__/image/og.png
// fonts: ['Inter:400', 'Inter:700'],
//
// defaults: { width: 1200, height: 600, emojis: 'noto', renderer: 'satori', component: 'NuxtSeo', cacheMaxAgeSeconds: 60 * 60 * 24 * 3 },
//
// disable at a global level
// runtimeCacheStorage: false,
},
linkChecker: {
enabled: false,
excludeLinks: ['https://twitter.com/vuedesigner'],
report: {
html: true,
markdown: true,
},
},
unocss: {
presets: [
presetIcons({
prefix: 'i-', // default prefix, do not change
}),
],
},
eslint: {
// config: {
// stylistic: {
// // All are default values
// semi: false,
// quotes: 'single',
// blockSpacing: true,
// indent: 2,
// commaDangle: 'always-multiline',
// // ...
// },
// },
// ...
},
pinegrow: {
liveDesigner: {
iconPreferredCase: 'unocss', // default value (can be removed), Nuxt UI uses the unocss format for icon names
devtoolsKey: 'devtoolsKey', // see plugins/devtools.client.ts
tailwindcss: {
/* Please ensure that you update the filenames and paths to accurately match those used in your project. */
configPath: 'tailwind.config.ts',
cssPath: '@/assets/css/tailwind.css',
// themePath: false, // Set to false so that Design Panel is not used
// restartOnConfigUpdate: true,
restartOnThemeUpdate: true,
},
// plugins: [
// {
// name: 'My Awesome Lib 3.0',
// key: 'my-awesome-lib',
// pluginPath: fileURLToPath(
// new URL('./web-types/my-awesome-lib.json', import.meta.url),
// ),
// },
// ],
},
},
})