Repository navigation
Expand file tree
/
Copy pathastro.config.mjs
More file actions
67 lines (65 loc) · 2.46 KB
/
Copy pathastro.config.mjs
File metadata and controls
67 lines (65 loc) · 2.46 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// @ts-check
import { fileURLToPath } from "node:url";
import { defineConfig } from "astro/config";
import { satteri } from "@astrojs/markdown-satteri";
import netlify from "@astrojs/netlify";
import sitemap from "@astrojs/sitemap";
import yaml from "@rollup/plugin-yaml";
const scssMixinsPath = fileURLToPath(
new URL("./src/styles/scss/mixins.scss", import.meta.url),
);
export default defineConfig({
site: "https://www.openhomefoundation.org",
// The site is fully prerendered except the routes that opt out with
// `export const prerender = false` (the asset-generator image endpoint),
// which the adapter runs as a Netlify function.
adapter: netlify({
// satori shapes text with harfbuzzjs, which reads its wasm from disk at
// runtime; the function bundler's trace only picks up the .js, so ship
// the wasm explicitly or every render crashes with ENOENT hb.wasm.
includeFiles: ["node_modules/harfbuzzjs/hb.wasm"],
}),
server: {
// Astro's dev server only binds to localhost by default. In a
// devcontainer/Codespace, forwarded ports can't reach a
// localhost-only listener, so bind to all interfaces.
host: true,
},
integrations: [
sitemap({
filter: (page) => {
const path = new URL(page).pathname;
// Media room sub-pages are press resources and carry noindex, as does
// the device database data use statement. Keep them out of the sitemap.
if (path.startsWith("/media-room/") && path !== "/media-room/")
return false;
if (path === "/device-database-data-use-statement/") return false;
return true;
},
}),
],
markdown: {
// Blog posts are written with their typography (curly quotes, dashes)
// already in place, and code blocks are styled by our own CSS.
processor: satteri({ features: { smartPunctuation: false } }),
syntaxHighlight: false,
},
vite: {
css: {
preprocessorOptions: {
scss: {
// Available in every Astro component's <style lang="scss">
// block without an explicit @use.
additionalData: `@use "${scssMixinsPath}" as *;`,
},
},
},
plugins: [yaml()],
build: {
// Browser floor for CSS: keeps/adds vendor prefixes (e.g.
// -webkit-backdrop-filter, -webkit-mask) for the Safari versions we
// still support, instead of the esnext default that strips them.
cssTarget: ["chrome111", "edge111", "firefox114", "safari15", "ios15"],
},
},
});