site-config-stack 0.8.13 → 0.8.14
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.
- package/dist/index.cjs +4 -3
- package/dist/index.mjs +5 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -73,11 +73,12 @@ function resolveSitePath(pathOrUrl, options) {
|
|
|
73
73
|
const parsed = ufo.parseURL(pathOrUrl);
|
|
74
74
|
path = parsed.pathname;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const base = ufo.withLeadingSlash(options.base);
|
|
77
|
+
if (base !== "/" && path.startsWith(base)) {
|
|
78
|
+
path = path.slice(base.length);
|
|
78
79
|
}
|
|
79
80
|
const origin = options.absolute ? options.siteUrl : "";
|
|
80
|
-
const baseWithOrigin = options.withBase ? ufo.withBase(
|
|
81
|
+
const baseWithOrigin = options.withBase ? ufo.withBase(base, origin || "/") : origin;
|
|
81
82
|
const resolvedUrl = ufo.withBase(path, baseWithOrigin);
|
|
82
83
|
return path === "/" ? ufo.withTrailingSlash(resolvedUrl) : fixSlashes(options.trailingSlash, resolvedUrl);
|
|
83
84
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasProtocol, withHttps, parseURL, withBase, withTrailingSlash, withoutTrailingSlash } from 'ufo';
|
|
1
|
+
import { hasProtocol, withHttps, parseURL, withLeadingSlash, withBase, withTrailingSlash, withoutTrailingSlash } from 'ufo';
|
|
2
2
|
|
|
3
3
|
const processShim = typeof process !== "undefined" ? process : {};
|
|
4
4
|
const envShim = processShim.env || {};
|
|
@@ -71,11 +71,12 @@ function resolveSitePath(pathOrUrl, options) {
|
|
|
71
71
|
const parsed = parseURL(pathOrUrl);
|
|
72
72
|
path = parsed.pathname;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const base = withLeadingSlash(options.base);
|
|
75
|
+
if (base !== "/" && path.startsWith(base)) {
|
|
76
|
+
path = path.slice(base.length);
|
|
76
77
|
}
|
|
77
78
|
const origin = options.absolute ? options.siteUrl : "";
|
|
78
|
-
const baseWithOrigin = options.withBase ? withBase(
|
|
79
|
+
const baseWithOrigin = options.withBase ? withBase(base, origin || "/") : origin;
|
|
79
80
|
const resolvedUrl = withBase(path, baseWithOrigin);
|
|
80
81
|
return path === "/" ? withTrailingSlash(resolvedUrl) : fixSlashes(options.trailingSlash, resolvedUrl);
|
|
81
82
|
}
|