-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
183 lines (174 loc) · 6.07 KB
/
nuxt.config.ts
File metadata and controls
183 lines (174 loc) · 6.07 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
172
173
174
175
176
177
178
179
180
181
182
183
import tailwindcss from '@tailwindcss/vite';
import config from 'config';
import assets from './src/lib/assets/index';
const version = assets.version;
const isRenderPreview = process.env.IS_PULL_REQUEST === 'true' && process.env.RENDER_EXTERNAL_URL;
const serverConfig: ServerConfig = config.get('server');
const serverHost = process.env.NODE_ENV === 'production'
? isRenderPreview
? process.env.RENDER_EXTERNAL_URL
: serverConfig.host
: '';
const assetsHost = process.env.NODE_ENV === 'production'
? isRenderPreview
? `${process.env.RENDER_EXTERNAL_URL}/assets/${version}`
: serverConfig.assetsHost
: `/assets/${version}`;
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-11-12',
runtimeConfig: {
public: {
serverHost,
assetsHost,
apiDocsHost: serverConfig.apiDocsHost,
assetsVersion: version,
apiHost: serverConfig.apiHost,
dashboardHost: serverConfig.dashboardHost,
},
},
app: {
head: {
title: 'Globalping - Internet and web infrastructure monitoring and benchmarking',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'theme-color', content: '#ffffff' },
{ name: 'description', content: 'Run free latency tests and network commands like ping, traceroute, HTTP and DNS resolve on probes located worldwide.' },
{ name: 'keywords', content: 'globalping, jsdelivr, free, open source, oss' },
{ property: 'og:title', content: 'Globalping - Internet and web infrastructure monitoring and benchmarking' },
{ property: 'og:description', content: 'Run free latency tests and network commands like ping, traceroute, HTTP and DNS resolve on probes located worldwide.' },
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: serverHost || 'https://globalping.io' },
{ property: 'og:image', content: `${assetsHost}/img/og-globalping.png` },
{ property: 'og:image:secure_url', content: `${assetsHost}/img/og-globalping.png` },
{ property: 'og:image:width', content: 1280 },
{ property: 'og:image:height', content: 640 },
{ property: 'og:site_name', content: 'Globalping' },
{ property: 'og:locale', content: 'en_US' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:title', content: 'Globalping - Internet and web infrastructure monitoring and benchmarking' },
{ name: 'twitter:description', content: 'Run free latency tests and network commands like ping, traceroute, HTTP and DNS resolve on probes located worldwide.' },
{ name: 'twitter:image', content: `${assetsHost}/img/og-globalping.png` },
{ name: 'twitter:site', content: '@jsdelivr' },
{ name: 'twitter:creator', content: '@jsdelivr' },
{ name: 'application-name', content: 'Globalping' },
{ name: 'apple-mobile-web-app-title', content: 'Globalping' },
{ name: 'msapplication-TileColor', content: '#ffffff' },
{ name: 'msapplication-config', content: '/icons/browserconfig.xml' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/icons/favicon.ico' },
{ rel: 'icon', type: 'image/svg+xml', href: '/icons/favicon.svg' },
{ rel: 'icon', type: 'image/png', href: '/icons/favicon-48x48.png', sizes: '48x48' },
{ rel: 'icon', type: 'image/png', href: '/icons/favicon-32x32.png', sizes: '32x32' },
{ rel: 'icon', type: 'image/png', href: '/icons/favicon-16x16.png', sizes: '16x16' },
{ rel: 'apple-touch-icon', href: '/icons/apple-touch-icon.png', sizes: '180x180' },
{ rel: 'manifest', href: '/icons/site.webmanifest' },
{ rel: 'mask-icon', color: '#0f172a', href: '/icons/safari-pinned-tab.svg' },
{ rel: 'dns-prefetch', href: 'https://cdn.jsdelivr.net' },
{ rel: 'preconnect', href: 'https://cdn.jsdelivr.net/' },
{ rel: 'sitemap', type: 'application/xml', href: '/sitemap/index.xml' },
{ rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css' },
],
script: [
{ src: 'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.slim.min.js', defer: true },
{ src: 'https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.js', defer: true },
{
type: 'application/ld+json',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Organization',
'name': 'Globalping',
'alternateName': 'globalping',
'description': 'A global, open source, network testing and monitoring platform',
'url': 'https://globalping.io',
'logo': 'https://cdn.jsdelivr.net/gh/jsdelivr/globalping-media@refs/heads/master/logo/full_colored_dark.svg',
'sameAs': [
'https://x.com/jsdelivr',
'https://www.linkedin.com/company/globalping/',
'https://github.com/jsdelivr/globalping',
],
}),
},
],
},
},
css: [
'~/assets/css/main.css',
],
modules: [
'@primevue/nuxt-module',
'@pinia/nuxt',
],
devtools: { enabled: true },
primevue: {
options: {
unstyled: true,
},
importPT: { as: 'Aura', from: '~/presets/aura' },
components: {
prefix: 'pv',
include: [ 'Paginator' ], // <- add primevue components to be bundled here (the same applies below)
},
directives: {
include: [ 'Tooltip' ],
},
composables: {
include: [],
},
},
vite: {
plugins: [
tailwindcss(),
{
name: 'ractive-cdn-config',
config (_, { isSsrBuild }) {
if (!isSsrBuild) {
return {
build: {
rollupOptions: {
output: {
paths: {
ractive: 'https://cdn.jsdelivr.net/npm/ractive@1.4.4/runtime.min.mjs',
},
},
},
},
};
}
},
},
],
build: {
rollupOptions: {
external: [ 'ractive' ],
},
},
server: {
hmr: {
port: 24679,
},
},
},
hooks: {
'build:manifest': (manifest) => {
for (const file of Object.values(manifest)) {
if (file.resourceType === 'image') {
file.prefetch = false;
}
}
},
},
nitro: {
externals: {
trace: false,
},
rollupConfig: {
output: {
minifyInternalExports: false,
chunkFileNames: 'chunks/[name].mjs',
},
},
},
});