Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:26
What would you like to do?
ClojureScript with zero dependencies (browser)

ClojureScript from master w/ zero dependencies

  1. git clone
  2. cd clojurescript; ./scripts/uberjar
  3. (^this creates cljs.jar in clojurescript/target; you will use it below)
  4. Create the following directory & file structure
 ├── build.clj
 ├── cljs.jar ;(created above)
 ├── index.html
 └── src
        └── core.cljs

in build.clj:

(require '
( "src" {:output-to "out/main.js"})

in index.html

<!DOCTYPE html>
    <script type="text/javascript" src="out/goog/base.js"></script>
    <script src="out/main.js"></script>
    <script type="text/javascript">

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment