         (-> (if (and (= :release mode) (seq file-min))
               (io/file file-min)
               (io/file file))
-            (.getCanonicalFile))]
+            (absolute-file))]
     (when-not (.exists file)
       (throw (ex-info "file override for require doesn't exist" {:file file :require require :config cfg})))
 

  (when name
    (let [file
          (-> (io/file dir name)
              (.getCanonicalFile))]
      (when (.exists file)
        file))))


(defn service? [x]
  (and (map? x) (::service x)))

(defn absolute-file
  ".getCanonicalFile resolves links but we just want to replace . and .."
  ^File [^File x]
  (-> x
      (.toPath)
      (.toAbsolutePath)
      (.normalize)
      (.toFile)))

(defn read-package-json
  "this caches the contents package.json files since we may access them quite often when resolving deps"
  [{:keys [index-ref] :as state} ^File file]
