Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using plain .js files (Google Closure'd) in ClojureScript build with lein-cljsbuild

I want to use some plain .js files in my ClojureScript project. I'm building it using lein-cljsbuild and the .js files are standard Google Closure namespaces with proper goog.provide declarations. So basically what I want is to merge them into the compilation sources that goes int the Closure Compiler. Is that possible?

like image 387
tillda Avatar asked Nov 02 '22 19:11

tillda


1 Answers

You should be able to add your Closure-aware JS files to :libs under the :compiler key in your build specification:

;; in project.clj
:cljsbuild {:builds [{:source-paths [...]
                      :compiler {:libs ["foo.js"]    ; <- add the libs here
                                 ...}}]}
like image 54
Michał Marczyk Avatar answered Nov 08 '22 04:11

Michał Marczyk