-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.config.ts
102 lines (99 loc) · 2.53 KB
/
astro.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
// Astro config file
import { defineConfig } from 'astro/config'
// PWA
import AstroPWA from '@vite-pwa/astro'
import { manifest } from './src/utils/seoConfig'
// Integrations
import tailwind from '@astrojs/tailwind'
import deno from '@astrojs/deno'
import robotsTxt from 'astro-robots-txt'
import preact from '@astrojs/preact'
import pageInsight from 'astro-page-insight'
import sitemap from '@astrojs/sitemap'
import mdx from '@astrojs/mdx'
// https://astro.build/config
export default defineConfig({
adapter: deno(),
compressHTML: true,
integrations: [
tailwind(),
robotsTxt(),
preact(),
pageInsight(),
sitemap({
filter: (page) =>
page !== 'https://jamerrq.deno.dev/board/' &&
page !== 'https://jamerrq.deno.dev/es/board/'
}),
mdx(),
AstroPWA({
registerType: 'autoUpdate',
manifest,
devOptions: {
enabled: true
},
workbox: {
globDirectory: 'dist/client',
globPatterns: [
'**/*.{woff2}',
'img/working_on/*.webp',
'pizarra.webp',
'img/this_is_fine.webp',
'movies/bitwise_liminal_compressed_240p.webm',
'_astro/*.module.*.js',
'_astro/client.*.js',
'_astro/hoisted.*.js',
'_astro/*icons.*.js'
],
// Don't fallback on document based (e.g. `/some-page`) requests
// This removes an errant console.log message from showing up.
navigateFallback: null, // 'offline.html' <- working on this
runtimeCaching: [
{
urlPattern: /\.(?:png|jpg|jpeg|svg|gif|webp|avif)$/,
handler: 'CacheFirst',
options: {
cacheName: 'images',
expiration: {
maxEntries: 100,
maxAgeSeconds: 30 * 24 * 60 * 60
}
}
},
{
urlPattern: /\.(?:woff|woff2|ttf|eot|ico)$/,
handler: 'CacheFirst',
options: {
cacheName: 'fonts',
expiration: {
maxEntries: 10,
maxAgeSeconds: 30 * 24 * 60 * 60
}
}
}
]
}
})
],
output: 'server',
i18n: {
locales: ['en', 'es'],
defaultLocale: 'en',
routing: {
prefixDefaultLocale: false,
strategy: 'pathname'
}
},
site: 'https://jamerrq.deno.dev',
image: {
domains: ['https://github.com/']
},
build: {
inlineStylesheets: 'always'
},
vite: {
build: {
cssMinify: 'lightningcss'
}
}
})