-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
126 lines (124 loc) · 3.28 KB
/
astro.config.mjs
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
import { ENV, LANGUAGE_EXTENDED, SITE_DESCRIPTION, SITE_NAME, ACCENT_COLOR, URL, DEBUG } from './src/config';
import { defineConfig, passthroughImageService } from 'astro/config';
import { astroCSPHashGenerator } from './src/utils/csp-hash';
import { fileURLToPath } from 'url';
import path from 'path';
// import partytown from '@astrojs/partytown';
// import sentry from "@sentry/astro";
// import sitemap from '@astrojs/sitemap';
import vercelServerless from '@astrojs/vercel/serverless';
import webmanifest from 'astro-webmanifest';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// https://astro.build/config
export default defineConfig({
site: URL || 'https://melanto.ro',
output: 'hybrid',
compressHTML: ENV !== 'local' && ENV !== 'development' ? true : false,
/*prefetch: {
defaultStrategy: 'viewport'
},*/
redirects: {
// '/old': '/new',
},
image: {
service: passthroughImageService(),
remotePatterns: [{
protocol: 'https'
}]
},
vite: {
logLevel: DEBUG ? 'info' : 'silent',
define: {
__DATE__: `'${new Date().toISOString()}'`
},
resolve: {
alias: {
'~': path.resolve(__dirname, './src')
}
}
},
markdown: {
syntaxHighlight: 'shiki',
remarkRehype: {
footnoteLabel: 'Note de subsol',
footnoteBackLabel: 'Înapoi la conținut'
},
shikiConfig: {
// Choose from Shiki's built-in themes (or add your own)
// https://github.com/shikijs/shiki/blob/main/docs/themes.md
theme: 'github-dark',
// Add custom languages
// Note: Shiki has countless langs built-in, including .astro!
// https://github.com/shikijs/shiki/blob/main/docs/languages.md
// import customLang from './custom.tmLanguage.json'
langs: [
// customLang,
],
// Enable word wrap to prevent horizontal scrolling
wrap: true
}
},
i18n: {
defaultLocale: 'ro',
locales: ['ro']
},
integrations: [
webmanifest({
name: SITE_NAME,
short_name: SITE_NAME,
lang: LANGUAGE_EXTENDED,
dir: 'ltr',
icon: 'public/favicon.svg',
description: SITE_DESCRIPTION,
start_url: '/',
theme_color: ACCENT_COLOR,
background_color: ACCENT_COLOR,
display: 'standalone',
config: {
outfile: 'site.webmanifest',
createFavicon: true,
insertFaviconLinks: true,
insertThemeColorMeta: false,
insertManifestLink: true,
crossOrigin: 'anonymous',
insertAppleTouchLinks: true,
iconPurpose: ['badge', 'maskable', 'monochrome']
}
}), /*partytown({
config: {
debug: true,
forward: ['dataLayer.push']
}
}),*/ /*sitemap({
customPages: ['https://melanto.ro/external-page2'],
filter: page => {
return page !== 'https://melanto.ro/dashboard/' && page !== 'https://melanto.ro/secret-vip-lounge-2/';
},
entryLimit: 10000,
changefreq: 'weekly',
priority: 0.7,
//lastmod: new Date(GLOBAL_PUB_DATE),
i18n: {
defaultLocale: 'ro',
locales: {
ro: 'ro-RO'
}
}
}),*/ /*sentry({
dsn: "https://b6e5cfd61e6adc839414daf452e8c4e8@o4506599007911936.ingest.sentry.io/4506599013548032",
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
sourceMapsUploadOptions: {
project: "melanto-ro",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
})*/
astroCSPHashGenerator,
],
adapter: vercelServerless({
webAnalytics: {
enabled: true,
},
// maxDuration: 8,
})
});