@directus/api
Version:
Directus is a real-time API and App dashboard for managing SQL database content
11 lines (9 loc) • 387 B
JavaScript
import { fileURLToPath } from "node:url";
import { pathToRelativeUrl } from "@directus/utils/node";
import { dirname } from "node:path";
//#region src/utils/import-file-url.ts
function importFileUrl(url, root, options = {}) {
return import(`./${pathToRelativeUrl(url, dirname(fileURLToPath(root)))}${options.fresh ? `?t=${Date.now()}` : ""}`);
}
//#endregion
export { importFileUrl };