-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
125 lines (120 loc) · 2.98 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
import alpinejs from '@astrojs/alpinejs';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import AstroPWA from '@vite-pwa/astro';
import icon from 'astro-icon';
import { remarkMastodonEmbed } from 'astro-mastodon';
import { defineConfig } from 'astro/config';
import { toString } from 'mdast-util-to-string';
import getReadingTime from 'reading-time';
import { SITE } from './src/config';
import react from '@astrojs/react';
import netlify from '@astrojs/netlify';
// import markdoc from '@astrojs/markdoc';
function remarkReadingTime() {
return function (tree, { data }) {
const textOnPage = toString(tree);
const readingTime = getReadingTime(textOnPage);
data.astro.frontmatter.minutesRead = readingTime.text;
};
}
// https://astro.build/config
export default defineConfig({
site: SITE.website,
trailingSlash: 'never',
vite: {
logLevel: 'info',
define: {
__DATE__: `'${new Date().toISOString()}'`,
},
server: {
fs: {
// Allow serving files from hoisted root node_modules
allow: ['../..']
}
},
},
markdown: {
remarkPlugins: [remarkReadingTime, remarkMastodonEmbed],
shikiConfig: {
theme: 'github-dark',
wrap: true,
},
},
prefetch: {
defaultStrategy: 'viewport',
},
integrations: [
tailwind({
applyBaseStyles: false,
}),
alpinejs(),
sitemap(),
icon(),
mdx(),
react(),
AstroPWA({
mode: 'production',
base: '/',
scope: '/',
includeAssets: ['favicon.png,og.png,apple-touch-icon.png,android-chrome-192x192.png,favicon-32x32.png'],
registerType: 'autoUpdate',
manifest: {
name: 'Rosnovsky Park™',
short_name: 'RPark',
theme_color: '#ffffff',
icons: [
{
src: 'android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'apple-touch-icon.png',
sizes: '180x180',
type: 'image/png',
},
{
src: 'favicon-32x32.png',
sizes: '32x32',
type: 'image/png',
},
{
src: 'favicon-16x16.png',
sizes: '16x16',
type: 'image/png',
}
],
},
workbox: {
maximumFileSizeToCacheInBytes: 3000000,
navigateFallback: '/',
globPatterns: ['**/*.{css,js,html,svg,png,ico,txt}'],
},
devOptions: {
enabled: true,
navigateFallbackAllowlist: [/^\//],
},
experimental: {
directoryAndTrailingSlashHandler: true,
}
}),
// markdoc(),
],
scopedStyleStrategy: 'where',
adapter: netlify(),
output: 'server',
server: {
port: 4321,
host: true,
},
optimizeDeps: {
include: ['react/jsx-runtime']
}
});