      (reset! *loaded* #{}))
    (when-not (contains? @*loaded* name)
      (let [env (:*env* bound-vars)]
-       (*load-fn* (ns->relpath name)
+       ((:*load-fn* bound-vars) (ns->relpath name)
          (fn [resolved]
            (assert (or (map? resolved) (nil? resolved))
              "*load-fn* may only return a map or nil")

       :*data-readers* tags/*cljs-data-readers*
       :*analyze-deps* (or (:analyze-deps opts) true)
       :*load-macros*  (or (:load-macros opts) true)
       :*eval-fn*      (or (:js-eval opts) js/eval)}
      source opts cb)))

;; -----------------------------------------------------------------------------

       :*cljs-ns*      'cljs.user
       :*ns*           (create-ns 'cljs.user)
       :*data-readers* tags/*cljs-data-readers*
       :*load-fn*      (or (:load-fn opts) *load-fn*)
       :*eval-fn*      (or (:eval-fn opts) *eval-fn*)}
      name opts cb))
  ([bound-vars name opts cb]
   (require bound-vars name nil opts cb))
