UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

18 lines (17 loc) 629 B
import { fileURLToPath } from "node:url"; import { dirname, resolve } from "node:path"; const cache = /* @__PURE__ */new Map(); async function workerImport(relativePath, callerUrl) { const callerDir = dirname(fileURLToPath(callerUrl)); const absolutePath = resolve(callerDir, relativePath); const cacheKey = absolutePath; if (cache.has(cacheKey)) { return cache.get(cacheKey); } const mjsPath = absolutePath.endsWith(".mjs") ? absolutePath : `${absolutePath}.mjs`; const mod = await import(mjsPath); cache.set(cacheKey, mod); return mod; } export { workerImport }; //# sourceMappingURL=workerImport.mjs.map