I guess a bit of documentation might come in handy since the documention on the compiler and externs is still poor
I wanted to include Hammer.js to my advanced compilation file output. So, I used the Closure extern generator to make a extern file. Adding the extern to my project.clj
was easy, but I wanted it to be included in the output javascript as well. Apparently :preamble
is meant for that, but it just didn't work. After a bit of fiddling around I found out that the preamble path is relative to <project root>/resources
.
{:id "production"
:source-paths ["src"]
:compiler {
:optimizations :advanced
:output-to "www/out/triplet_mobile.js"
:pretty-print false
:preamble ["react/react.min.js" "hammerjs/hammer.js"]
:externs ["react/externs/react.js" "hammer.extern.js"]
}