File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,10 @@ 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" ;
1413
14+ import compress from "astro-compress" ;
15+
1516let gitVersion = String ( process . env . GIT_VERSION ?? "" ) . slice ( 0 , 7 ) ;
1617
1718if ( ! 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
3053export 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 : {
You can’t perform that action at this time.
0 commit comments