From 7efb78818887c9fd10767f6983e1707fe18d6599 Mon Sep 17 00:00:00 2001 From: Gabriel Pinto Date: Tue, 5 Nov 2024 19:15:20 +0000 Subject: [PATCH] fix: asset routing --- packages/next-on-fleek/src/buildApplication/generateGlobalJs.ts | 2 +- packages/next-on-fleek/templates/_worker.js/utils/fetch.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next-on-fleek/src/buildApplication/generateGlobalJs.ts b/packages/next-on-fleek/src/buildApplication/generateGlobalJs.ts index 97cc4f110..1f5ab6a49 100644 --- a/packages/next-on-fleek/src/buildApplication/generateGlobalJs.ts +++ b/packages/next-on-fleek/src/buildApplication/generateGlobalJs.ts @@ -107,7 +107,7 @@ export function generateGlobalJs(): string { let assetPath = pathname; if (!/\\.[^.]+$/.test(assetPath)) { const noExt = pathname.replace(/.html$/, ''); - assetPath = \`\${noExt.replace(/^\\/$/, '/index')}.html\`; + assetPath = \`\${noExt.replace(/\\/$/, '/index')}.html\`; } const response = await fetch( diff --git a/packages/next-on-fleek/templates/_worker.js/utils/fetch.ts b/packages/next-on-fleek/templates/_worker.js/utils/fetch.ts index 01d9134bc..397178618 100644 --- a/packages/next-on-fleek/templates/_worker.js/utils/fetch.ts +++ b/packages/next-on-fleek/templates/_worker.js/utils/fetch.ts @@ -75,7 +75,7 @@ globalThis.ASSETS = { let assetPath = pathname; if (/\.[^.]+$/.test(assetPath)) { const noExt = pathname.replace(/\.html$/, ''); - assetPath = `${noExt.replace(/^\/$/, '/index')}.html`; + assetPath = `${noExt.replace(/\/$/, '/index')}.html`; } const response = await fetch(