A complete, working sample project to demonstrate working code with external JavaScript dependency
Say you have a JavaScript library you need to include in a ClojureScript project. We have an
example file dino.js
we wish to depend on. The file dino-externs.js
shows how to tell the
Google Closure compiler about the dependency. The project.clj
file shows the right syntax to make
everything work as it should.
Project was created using lein new figwheel
Prior to running, you must install NodeJS dependencies:
./npm-install.bash # => downloads npm modules (saved in `./node_modules` dir)
To get an interactive development environment run:
lein clean ; lein figwheel
A browser window will open. Go to the developer console to view results.
To clean all compiled files:
lein clean # very important if build crashes & corrupt output files remain
To run Doo tests:
lein doo phantom test once # run the tests once and exit (note: not `phantomjs`)
lein doo phantom test # rerun the tests after every file edit (*** CURRENTLY BROKEN ***)
lein doo chrome test once # can also test using Chrome browser
lein doo chrome test # rerun the tests after every file edit (*** CURRENTLY BROKEN ***)