Skip to content

Commit

Permalink
wip: fix windows file import
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Mar 1, 2024
1 parent 5c467c6 commit 1a669ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/db/src/core/load-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ async function importBundledFile({
root: URL;
}): Promise<{ default?: unknown }> {
// Write it to disk, load it with native Node ESM, then delete the file.
const tmpFileUrl = new URL(`studio.seed.timestamp-${Date.now()}.mjs`, root);
const tmpFileUrl = new URL(`db.timestamp-${Date.now()}.mjs`, root);
await writeFile(tmpFileUrl, code);
try {
return await import(/* @vite-ignore */ tmpFileUrl.pathname);
return await import(/* @vite-ignore */ tmpFileUrl.href);
} finally {
try {
await unlink(tmpFileUrl);
Expand Down

0 comments on commit 1a669ea

Please sign in to comment.