File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
99import metaTags from "astro-meta-tags" ;
1010import pagefind from "astro-pagefind" ;
1111import deleteUnusedImages from "astro-delete-unused-images" ;
12- import preload from "astro-preload" ;
1312import { execSync } from "node:child_process" ;
14-
1513import compress from "astro-compress" ;
1614
1715let 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
3252export 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 : {
You can’t perform that action at this time.
0 commit comments