-
-
Notifications
You must be signed in to change notification settings - Fork 424
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
116 lines (103 loc) · 2.3 KB
/
nuxt.config.ts
File metadata and controls
116 lines (103 loc) · 2.3 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
export default defineNuxtConfig({
modules: [
function (_, nuxt) {
if (nuxt.options._prepare) {
nuxt.options.pwa ||= {}
nuxt.options.pwa.pwaAssets ||= {}
nuxt.options.pwa.pwaAssets.disabled = true
}
},
'@unocss/nuxt',
'@nuxtjs/html-validator',
'@nuxt/scripts',
'@nuxt/fonts',
'nuxt-og-image',
'@nuxt/test-utils',
'@vite-pwa/nuxt',
],
devtools: { enabled: true },
app: {
head: {
htmlAttrs: { lang: 'en' },
},
},
vue: {
compilerOptions: {
isCustomElement: tag => tag === 'search',
},
},
site: {
url: 'https://npmx.dev',
name: 'npmx',
description: 'A fast, modern browser for the npm registry',
},
routeRules: {
'/': { prerender: true },
'/**': { isr: 60 },
'/package/**': { isr: 60 },
'/search': { isr: false, cache: false },
'/_v/script.js': { proxy: 'https://npmx.dev/_vercel/insights/script.js' },
'/_v/view': { proxy: 'https://npmx.dev/_vercel/insights/view' },
'/_v/event': { proxy: 'https://npmx.dev/_vercel/insights/event' },
'/_v/session': { proxy: 'https://npmx.dev/_vercel/insights/session' },
},
experimental: {
viteEnvironmentApi: true,
viewTransition: true,
typedPages: true,
},
compatibilityDate: '2024-04-03',
nitro: {
externals: {
inline: [
'shiki',
'@shikijs/langs',
'@shikijs/themes',
'@shikijs/types',
'@shikijs/engine-javascript',
'@shikijs/core',
],
},
},
fonts: {
families: [
{
name: 'Geist',
weights: ['400', '500', '600'],
global: true,
},
{
name: 'Geist Mono',
weights: ['400', '500'],
global: true,
},
],
},
htmlValidator: {
failOnError: true,
},
ogImage: {
defaults: {
component: 'Default',
},
},
pwa: {
// Disable service worker - only using for asset generation
disable: true,
pwaAssets: {
config: true,
},
manifest: {
name: 'npmx',
short_name: 'npmx',
description: 'A fast, modern browser for the npm registry',
theme_color: '#0a0a0a',
background_color: '#0a0a0a',
},
},
vite: {
optimizeDeps: {
include: ['@vueuse/core', 'vue-data-ui/vue-ui-sparkline'],
},
},
})