Skip to content

Commit a7a4fce

Browse files
committed
wip
1 parent 1abc090 commit a7a4fce

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/nbb/core.cljs

+9-11
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,16 @@
146146
((.-resolve (:require @ctx)) libname))))
147147
(js/Promise.resolve ((.-resolve (:require @ctx)) libname)))
148148
(.then (fn [path]
149-
(let [file (if (str/starts-with? path "file:")
150-
(url/fileURLToPath path)
151-
path)
152-
file? (delay (fs/existsSync file))
153-
path* (if (and reload?
149+
;; (prn :path path)
150+
(let [file-url (if (str/starts-with? path "file:")
151+
path
152+
(when (fs/existsSync path)
153+
(url/pathToFileURL path)))
154+
path (if (and reload?
154155
;; not "node:fs" etc
155-
@file?)
156-
(str file "?uuid=" (random-uuid))
157-
path)
158-
path (if (and windows? @file?)
159-
(str (url/pathToFileURL path*))
160-
path*)]
156+
file-url)
157+
(str file-url "?uuid=" (random-uuid))
158+
path)]
161159
(esm/dynamic-import path))))
162160
(.then (fn [mod]
163161
(register-module mod internal-name)

0 commit comments

Comments
 (0)