@megabudino/stack-utils 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ function originPattern(origin) {
25
25
  * - When `proxyAssets` is false, absolute origin URLs are left as-is.
26
26
  */
27
27
  export function rewriteHtml(html, originUrl, siteUrl, proxyAssets = false, additionalOrigins = []) {
28
- html = html.replace(domainPattern(siteUrl), 'href="$2"');
28
+ html = html.replace(domainPattern(siteUrl), (_, _www, path) => `href="${path || '/'}"`);
29
29
  html = html.replace(/(<link[^>]*rel=["']canonical["'][^>]*href=["'])([^"']*)["']/gi, (_, prefix, value) => {
30
30
  try {
31
31
  value = new URL(value).pathname;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megabudino/stack-utils",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Reusable utilities for a SvelteKit stack, including a reverse proxy and static image pipeline",
5
5
  "type": "module",
6
6
  "exports": {