astro
Version:
Astro is a modern site builder with web best practices, performance, and DX front-of-mind.
12 lines (11 loc) • 402 B
JavaScript
import { resolveIdToUrl } from "../core/viteUtils.js";
export function createResolve(loader, root) {
// Resolves specifiers in the inline hydrated scripts, such as:
// - @astrojs/preact/client.js
// - @/components/Foo.vue
// - /Users/macos/project/src/Foo.vue
// - C:/Windows/project/src/Foo.vue (normalized slash)
return async function(s) {
return await resolveIdToUrl(loader, s, root);
};
}