Skip to content
Robert Stuttaford edited this page Mar 18, 2015 · 22 revisions

The :foreign-libs feature provided by Clojurescript. Does not have any support for non-JavaScript files like CSS files and images.

Many JavaScript libraries depend on additional assets like CSS and images.

Currently there is no predefined way to solve this problem. This page is meant to document and discuss ongoing efforts in this area.

  • A Boot-specific solution utilizing the fileset is documented in boot-cljsjs #21 (fleshing this out into a Wiki page would be welcome).
  • A similar approach has been discussed in the Hoplon forum

By example, using cljsjs/c3:

In build.boot:

(deftask build []
  (comp (sift :add-jar {'cljsjs/c3 #"^cljsjs/c3/common/c3.min.css$"})
        (cljs)))

In index.html:

<link rel="stylesheet" type="text/css" href="cljsjs/c3/common/c3.min.css">