Skip to content

Commit 5603c7b

Browse files
committed
Fix failing build process
1 parent 06fc6de commit 5603c7b

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

astro.config.mjs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ 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";
14-
1513
import compress from "astro-compress";
1614

1715
let gitVersion = String(process.env.GIT_VERSION ?? "").slice(0, 7);
@@ -28,6 +26,28 @@ if (!gitVersion) {
2826
}
2927
}
3028

29+
function dontDie() {
30+
return {
31+
name: "dont-die",
32+
hooks: {
33+
"astro:config:setup": () => {
34+
process.on("uncaughtException", (error) => {
35+
if (
36+
error.message &&
37+
error.message.includes("Failed to load remote image")
38+
) {
39+
console.warn(
40+
"[dont-die] Caught remote image error:",
41+
error.message
42+
);
43+
return;
44+
}
45+
});
46+
},
47+
},
48+
};
49+
}
50+
3151
// https://astro.build/config
3252
export default defineConfig({
3353
vite: {
@@ -81,7 +101,6 @@ export default defineConfig({
81101
"/speaker/savannah-ostrowski": "/speaker/savannah-bailey",
82102
},
83103
integrations: [
84-
preload(),
85104
mdx(),
86105
sitemap(),
87106
tailwind({
@@ -90,9 +109,10 @@ export default defineConfig({
90109
metaTags(),
91110
pagefind(),
92111
deleteUnusedImages(),
93-
(await import("astro-compress")).default({
112+
compress({
94113
SVG: false,
95114
}),
115+
dontDie(),
96116
],
97117
output: "static",
98118
build: {

public/assets/preloaded/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)