Skip to content

Commit baf21af

Browse files
committed
Fix failing build process
1 parent ee67457 commit baf21af

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

astro.config.mjs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
99
import metaTags from "astro-meta-tags";
1010
import pagefind from "astro-pagefind";
1111
import deleteUnusedImages from "astro-delete-unused-images";
12-
import preload from "astro-preload";
1312
import { execSync } from "node:child_process";
1413

14+
import compress from "astro-compress";
15+
1516
let gitVersion = String(process.env.GIT_VERSION ?? "").slice(0, 7);
1617

1718
if (!gitVersion) {
@@ -26,6 +27,28 @@ if (!gitVersion) {
2627
}
2728
}
2829

30+
function dontDie() {
31+
return {
32+
name: "dont-die",
33+
hooks: {
34+
"astro:config:setup": () => {
35+
process.on("uncaughtException", (error) => {
36+
if (
37+
error.message &&
38+
error.message.includes("Failed to load remote image")
39+
) {
40+
console.warn(
41+
"[dont-die] Caught remote image error:",
42+
error.message
43+
);
44+
return;
45+
}
46+
});
47+
},
48+
},
49+
};
50+
}
51+
2952
// https://astro.build/config
3053
export default defineConfig({
3154
vite: {
@@ -79,7 +102,6 @@ export default defineConfig({
79102
"/speaker/savannah-ostrowski": "/speaker/savannah-bailey",
80103
},
81104
integrations: [
82-
preload(),
83105
mdx(),
84106
sitemap(),
85107
tailwind({
@@ -88,9 +110,10 @@ export default defineConfig({
88110
metaTags(),
89111
pagefind(),
90112
deleteUnusedImages(),
91-
(await import("astro-compress")).default({
113+
compress({
92114
SVG: false,
93115
}),
116+
dontDie(),
94117
],
95118
output: "static",
96119
build: {

public/assets/preloaded/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)