generated from Pinegrow/pg-nuxtui-shadcn-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
287 lines (264 loc) · 7.1 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
// import { fileURLToPath, URL } from 'node:url'
// import presetIcons from '@unocss/preset-icons'
import site from './site'
const {
name,
description,
url,
defaultLocale,
identity,
twitter,
trailingSlash,
titleSeparator,
} = site
export default defineNuxtConfig({
extends: [
'./packages/my-nuxtui-layer', // NavBar and Footer components
'./packages/my-shadcn-vue-layer', // Shadcn-Vue blocks
],
// ssr: false,
devtools: { enabled: false }, // Disable when using Vue devtools
experimental: {
componentIslands: true,
},
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 & @unocss/preset-icons is not required, as Nuxt UI already includes an UIcon component that uses egoist/tailwindcss-icons which also uses the same unocss format for icon names, for example, i-mdi-home.
'@nuxt/devtools',
'@nuxt/content',
'@vueuse/nuxt',
'@pinia/nuxt',
// '@nuxtjs/html-validator',
'@nuxt/image',
'@vee-validate/nuxt',
'@nuxtseo/module',
'@nuxtjs/fontaine',
'@nuxtjs/critters',
'@nuxt/ui',
'nuxt-icon',
],
colorMode: {
preference: 'light',
},
ui: {
icons: 'all',
// safelistColors: [
// 'primary',
// 'secondary',
// 'tertiary',
// 'success',
// 'warning',
// 'error',
// 'info',
// ],
},
// https://dev.to/jacobandrewsky/improving-performance-of-nuxt-with-fontaine-5dim
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',
},
},
// Vuetify's 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,
// },
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: {
markdown: {
anchorLinks: false,
rehypePlugins: [
[
'rehype-external-links',
{
target: '_blank',
rel: ['noopener'],
test: (node: any) => /^https?:\/\//.test(node.properties.href),
},
],
],
},
highlight: {
theme: 'dracula-soft',
},
},
pinia: {
autoImports: [
// automatically imports `defineStore`
'defineStore', // import { defineStore } from 'pinia'
['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
'storeToRefs',
'acceptHMRUpdate',
],
},
imports: {
dirs: ['stores'],
},
vue: {
compilerOptions: {
isCustomElement: (tag) => tag === 'lite-youtube',
},
},
sourcemap: {
client: false,
server: false,
},
routeRules: {
'/hidden': { index: false },
},
// Used by all modules in the @nuxtseo/module 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 https://the-ai-cafe.netlify.app/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: {
// Open https://the-ai-cafe.netlify.app/__og_image__/og.png
// defaults: {
// cacheTtl: 60 * 60 * 24 * 7, // 7 days
// },
// disable at a global level
// runtimeCacheStorage: false,
// or
// defaults: {
// cache: false,
// },
},
linkChecker: {
enabled: false,
excludeLinks: ['https://twitter.com/vuedesigner'],
report: {
html: true,
markdown: true,
},
},
// unocss: {
// presets: [
// presetIcons({
// prefix: 'i-', // default prefix, do not change
// }),
// ],
// },
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('./my-awesome-lib/web-types.json', import.meta.url),
// ),
// },
// ],
},
},
})