-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
77 lines (74 loc) · 1.68 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
import { defineConfig } from 'astro/config'
import tunnel from 'astro-tunnel'
import tailwind from '@astrojs/tailwind'
import react from '@astrojs/react'
import playformInline from '@playform/inline'
import sitemap from 'astro-sitemap'
import playformCompress from '@playform/compress'
import compressor from 'astro-compressor'
const website = 'https://example.com'
// https://astro.build/config
export default defineConfig({
site: website,
trailingSlash: 'never',
server: {
host: true
},
prefetch: {
prefetchAll: true,
defaultStrategy: 'viewport'
},
compressHTML: false,
integrations: [
tunnel(),
tailwind(),
react(),
playformInline(),
sitemap({
canonicalURL: website,
lastmod: new Date(),
createLinkInHead: false,
xmlns: {
xhtml: true
},
i18n: {
defaultLocale: 'es',
locales: {
es: 'es'
}
},
// Remove trailing slash
serialize(item) {
/* eslint-disable-next-line no-param-reassign */
item.url = item.url.replace(/\/$/g, '')
return item
}
}),
playformCompress({
HTML: {
collapseBooleanAttributes: true,
maxLineLength: 0,
removeAttributeQuotes: false,
removeComments: true,
removeEmptyAttributes: true,
removeOptionalTags: true,
removeRedundantAttributes: true,
useShortDoctype: true
},
JavaScript: {
compress: {
ecma: 2015
},
format: {
comments: false,
ecma: 2015
},
ecma: 2015,
module: true
},
Image: false,
SVG: false
}),
compressor()
]
})