Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 7, 2024
1 parent 1abc090 commit a7a4fce
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/nbb/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,16 @@
((.-resolve (:require @ctx)) libname))))
(js/Promise.resolve ((.-resolve (:require @ctx)) libname)))
(.then (fn [path]
(let [file (if (str/starts-with? path "file:")
(url/fileURLToPath path)
path)
file? (delay (fs/existsSync file))
path* (if (and reload?
;; (prn :path path)
(let [file-url (if (str/starts-with? path "file:")
path
(when (fs/existsSync path)
(url/pathToFileURL path)))
path (if (and reload?
;; not "node:fs" etc
@file?)
(str file "?uuid=" (random-uuid))
path)
path (if (and windows? @file?)
(str (url/pathToFileURL path*))
path*)]
file-url)
(str file-url "?uuid=" (random-uuid))
path)]
(esm/dynamic-import path))))
(.then (fn [mod]
(register-module mod internal-name)
Expand Down

0 comments on commit a7a4fce

Please sign in to comment.