Ver Fonte

fix(dashboard): Fix asset imports in built index.html

Michael Bromley há 7 meses atrás
pai
commit
3ad6634169
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      packages/dashboard/vite/vite-plugin-transform-index.ts

+ 1 - 1
packages/dashboard/vite/vite-plugin-transform-index.ts

@@ -25,7 +25,7 @@ export function transformIndexHtmlPlugin(): Plugin {
                 const basePath = config.base.replace(/\/$/, ''); // Remove trailing slash
 
                 // Single regex to handle both href and src attributes with any quote type
-                const attributeRegex = new RegExp(`(href|src)=(["'])${basePath}`, 'g');
+                const attributeRegex = new RegExp(`(href|src)=(["'])${basePath}/?`, 'g');
                 let transformedHtml = html.replace(attributeRegex, '$1=$2');
 
                 // Add base tag to head