astro
Version:
Astro is a modern site builder with web best practices, performance, and DX front-of-mind.
23 lines (22 loc) • 483 B
JavaScript
import { fileURLToPath } from "node:url";
import { resolveEntrypoint } from "../utils.js";
class RequireLocalProviderUrlResolver {
#root;
// TODO: remove when stabilizing
#intercept;
constructor({
root,
intercept
}) {
this.#root = root;
this.#intercept = intercept;
}
resolve(input) {
const path = fileURLToPath(resolveEntrypoint(this.#root, input));
this.#intercept?.(path);
return path;
}
}
export {
RequireLocalProviderUrlResolver
};