forked from TheOtterlord/manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
32 lines (30 loc) · 865 Bytes
/
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
import { defineConfig } from 'astro/config';
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import { SITE_URL } from './src/site_config';
// https://astro.build/config
export default defineConfig({
site: SITE_URL,
integrations: [tailwind(), sitemap()],
vite: {
plugins: [rawFonts(['.ttf'])],
optimizeDeps: { exclude: ['@resvg/resvg-js'] }
},
// Allows early access to Astro's new image optimization, which supports markdown
// https://astro.build/blog/images/
experimental: { assets: true },
});
function rawFonts(ext) {
return {
name: 'vite-plugin-raw-fonts',
transform(_, id) {
if (ext.some(e => id.endsWith(e))) {
const buffer = fs.readFileSync(id);
return {
code: `export default ${JSON.stringify(buffer)}`,
map: null
};
}
}
};
}