clojureclojurescriptboot-cljhoplon

How to add the clojure.string library to a front-end Hoplon project using the Boot-clj build tool


I hope these questions are helping someone. I am new to both Hoplon and Boot. I am trying to use the "clojure.string" library in a Hoplon project and I can't seem to get it. I tried in the index.cljs.hl file:

(:require [clojure.string :as str]))

And then it doesn't load. Next I tried including the library in the build.boot tool but neither seemed to work:

 [org.clojure/clojure.string "1.8.0"]
 [org.clojure/clojure-string "1.8.0"]

Neither of those seemed to work so I am looking on how I can use the string library.

Cheers, Matt


Solution

  • After much searching I finally figured out how to do it. All you need to do is in the "index.cljs.hl" file add the following at the top.

    (page "index.html"
        (:require [clojure.string :as str]))
    

    And then you can access the string library as (str/split etc.

    Cheers, Matt