ClojureScript from master w/ zero dependencies
- git clone https://github.com/clojure/clojurescript.git
- cd clojurescript; ./scripts/uberjar
- (^this creates cljs.jar in clojurescript/target; you will use it below)
- Create the following directory & file structure
foo ├── build.clj ├── cljs.jar ;(created above) ├── index.html └── src └──foo └── core.cljs
in build.clj:
(require 'cljs.build.api)
(cljs.build.api/build "src" {:output-to "out/main.js"})
in index.html
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript" src="out/goog/base.js"></script>
<script src="out/main.js"></script>
<script type="text/javascript">
goog.require("foo.core");
</script>
</body>
</html>
in core.cljs:
(ns foo.core)
; your code here
run java -cp cljs.jar:src clojure.main build.clj
from ./my-example
then open index.html.