File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ 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" ;
13+ import compress from "astro-compress" ;
1414
1515let gitVersion = String ( process . env . GIT_VERSION ?? "" ) . slice ( 0 , 7 ) ;
1616
@@ -26,6 +26,28 @@ if (!gitVersion) {
2626 }
2727}
2828
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+
2951// https://astro.build/config
3052export default defineConfig ( {
3153 vite : {
@@ -79,7 +101,6 @@ export default defineConfig({
79101 "/speaker/savannah-ostrowski" : "/speaker/savannah-bailey" ,
80102 } ,
81103 integrations : [
82- preload ( ) ,
83104 mdx ( ) ,
84105 sitemap ( ) ,
85106 tailwind ( {
@@ -88,9 +109,10 @@ export default defineConfig({
88109 metaTags ( ) ,
89110 pagefind ( ) ,
90111 deleteUnusedImages ( ) ,
91- ( await import ( "astro- compress" ) ) . default ( {
112+ compress ( {
92113 SVG : false ,
93114 } ) ,
115+ dontDie ( ) ,
94116 ] ,
95117 output : "static" ,
96118 build : {
You can’t perform that action at this time.
0 commit comments