Skip to content

Commit

Permalink
Auto commit for changes in svelte.config.js
Browse files Browse the repository at this point in the history
Changes in svelte.config.js:\n\ndiff --git a/svelte.config.js b/svelte.config.js
index 0716cbe..646b929 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -6,6 +6,17 @@ const config = {
 		adapter: adapter(),
 		paths: {
 			base: "/tools"
+		},
+		prerender: {
+			handleHttpError: ({ path, referrer, message }) => {
+				// Ignore deliberate link to shiny 404 page
+				if (path === '/not-found' && referrer === '/tools/error') {
+					return;
+				}
+
+				// Otherwise fail the build
+				throw new Error(message);
+			}
 		}
 	},
 	preprocess: vitePreprocess()

Signed-off-by: Memet Zx <zxce3@gnuweeb.org>
  • Loading branch information
Zxce3 committed Jan 30, 2024
1 parent a8af268 commit 0ce1892
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ const config = {
adapter: adapter(),
paths: {
base: "/tools"
},
prerender: {
handleHttpError: ({ path, referrer, message }) => {
// Ignore deliberate link to shiny 404 page
if (path === '/not-found' && referrer === '/tools/error') {
return;
}

// Otherwise fail the build
throw new Error(message);
}
}
},
preprocess: vitePreprocess()
Expand Down

0 comments on commit 0ce1892

Please sign in to comment.