mirror of https://github.com/status-im/clj-rn.git
resources with prefix
This commit is contained in:
parent
86c0bfdb73
commit
c2e09bcb25
|
@ -109,14 +109,18 @@
|
|||
(defn get-modules
|
||||
[resource-dirs js-modules]
|
||||
(->> (for [dir resource-dirs]
|
||||
(->> (file-seq (io/file dir))
|
||||
(filter #(and (not (re-find #"DS_Store" (str %)))
|
||||
(.isFile %)))
|
||||
(map (fn [file] (when-let [unix-path (->> file .toPath .iterator iterator-seq (str/join "/"))]
|
||||
(-> (str "./" unix-path)
|
||||
(str/replace "\\" "/")
|
||||
(str/replace "@2x" "")
|
||||
(str/replace "@3x" "")))))))
|
||||
(let [{:keys [path prefix]} (if (map? dir)
|
||||
dir
|
||||
{:path dir
|
||||
:prefix "./"})]
|
||||
(->> (file-seq (io/file path))
|
||||
(filter #(and (not (re-find #"DS_Store" (str %)))
|
||||
(.isFile %)))
|
||||
(map (fn [file] (when-let [unix-path (->> file .toPath .iterator iterator-seq (str/join "/"))]
|
||||
(-> (str prefix unix-path)
|
||||
(str/replace "\\" "/")
|
||||
(str/replace "@2x" "")
|
||||
(str/replace "@3x" ""))))))))
|
||||
flatten
|
||||
(concat js-modules ["react" "react-native" "create-react-class"])
|
||||
distinct))
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
(s/def :config/name (and not-empty-string? #(re-matches #"^[A-Z][A-Za-z0-9]+$" %)))
|
||||
(s/def :config/js-modules (s/coll-of not-empty-string?))
|
||||
(s/def :config/desktop-modules (s/coll-of not-empty-string?))
|
||||
(s/def :config/resource-dirs (s/coll-of not-empty-string?))
|
||||
(s/def :config/resource-dirs (s/coll-of (s/or not-empty-string? map?)))
|
||||
(s/def :config/figwheel-bridge not-empty-string?)
|
||||
(s/def :config/figwheel-options map?)
|
||||
(s/def :config/builds (s/coll-of map?))
|
||||
|
|
Loading…
Reference in New Issue