18 lines
372 B
JavaScript
18 lines
372 B
JavaScript
import { fileURLToPath } from "node:url";
|
|
import { resolveEntrypoint } from "../utils.js";
|
|
function createRequireLocalProviderUrlResolver({
|
|
root,
|
|
intercept
|
|
}) {
|
|
return {
|
|
resolve(input) {
|
|
const path = fileURLToPath(resolveEntrypoint(root, input));
|
|
intercept?.(path);
|
|
return path;
|
|
}
|
|
};
|
|
}
|
|
export {
|
|
createRequireLocalProviderUrlResolver
|
|
};
|