From 9030aaeda631fec3bcf6c1912fd7b1d3719c2f7f Mon Sep 17 00:00:00 2001 From: RamiR Date: Fri, 6 Feb 2026 01:57:30 -0600 Subject: [PATCH] fix: correct regex for folder names containing 'index' The regex /\/?index/g was removing all occurrences of 'index' from the entire path, not just the trailing '/index' from the filename. This caused folder names containing 'index' (e.g., 'something-momentum-index') to be corrupted during build. Changed to /\/?index$/ to only match '/index' at the end of the path. Fixes #3263 --- .../src/pages/api/[...route]/evidencemeta.json/+server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/example-project/src/pages/api/[...route]/evidencemeta.json/+server.js b/sites/example-project/src/pages/api/[...route]/evidencemeta.json/+server.js index 3bee2da692..6dd7c7204b 100644 --- a/sites/example-project/src/pages/api/[...route]/evidencemeta.json/+server.js +++ b/sites/example-project/src/pages/api/[...route]/evidencemeta.json/+server.js @@ -18,7 +18,7 @@ export const entries = async () => { // Example Project is special const removal = isExampleProject ? '/+page.md' : '.md'; let result = filepath.slice(0, -removal.length); - if (filepath.endsWith('index.md')) result = result.replaceAll(/\/?index/g, ''); + if (filepath.endsWith('index.md')) result = result.replace(/\/?index$/, ''); return { route: result }; });