-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
52 lines (41 loc) · 1.28 KB
/
Copy pathastro.config.mjs
File metadata and controls
52 lines (41 loc) · 1.28 KB
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
import path from 'path';
import { fileURLToPath } from 'url';
import { defineConfig } from 'astro/config';
// import sitemap from '@astrojs/sitemap';
import partytown from '@astrojs/partytown';
import { SITE } from './src/config.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// https://astro.build/config
export default defineConfig({
// Astro v4 fails to generate full URL of sitemap and canonical URLs in final build
site: SITE.origin, // Just the domain
base: SITE.basePathname, // The repo name
outDir: 'dist', // dist folder for GitHub Pages
trailingSlash: 'always', // Vital for GitHub Pages folders
output: 'static',
islands: true,
images: {
service: '@astrojs/sharp', // Force Sharp service, but it keeps using webp format
formats: ['avif', 'webp'],
},
// Enable islands for Astro 4.0+
// islands: true,
// integrations: [sitemap()],
// ------------------------------
// ⚠ Fail to build sitemap ⚠
// ------------------------------
// integrations: [
// sitemap({
// // Force the sitemap to ignore any "broken" or "undefined" routes
// filter: (page) => page !== undefined,
// })
// ],
vite: {
resolve: {
alias: {
'~': path.resolve(__dirname, './src'),
},
},
plugins: [],
},
});