          (let [dep (first deps)]
            (when-not (or (not-empty (get-in compiler [::namespaces dep :defs]))
                        (contains? (:js-dependency-index compiler) (name dep)))
-             (require name
+             (*load-fn* name
                (fn [source]
                  (if-not (nil? source)
                    (analyze* env bound-vars source

                       (ana/error-message :undeclared-ns
                         {:ns-sym dep :js-provide (name dep)}))))))))
         (cb))))))

(defn analyze [env source cb]
  (analyze* env

;; -----------------------------------------------------------------------------
;; Analyze

(defn require
  ([name cb]
   (*load-fn* name cb))
  ([name reload cb]
   (*load-fn* name cb)))

(defn analyze* [env bound-vars source cb]
  (let [rdr  (rt/string-push-back-reader source)
