I have Leiningen installed and the project all set up. Someone told me to use the "lein cljsbuild once" command to convert Clojure to JavaScript. This did not fully answer my question because I'm having trouble understanding the folder structure of the project.
This is my project.clj:
(defproject proj "2.3.4"
:plugins [[lein-cljsbuild "1.0.1-SNAPSHOT"]]
:cljsbuild {
:builds [{
; The path to the top-level ClojureScript source directory:
:source-paths ["src"]
; The standard ClojureScript compiler options:
; (See the ClojureScript compiler documentation for details.)
:dependencies [[org.clojure/clojure "1.5.1"]]
:main project.clj
:compiler {
:optimizations :whitespace
:pretty-print true}}]})
The way I understand it is that it automatically detects files found in the "src" folder and outputs them to target/clojurescript-main.js (or something similar). I put the file I want to convert into the src folder and it seems to compile something. When I check the target folder it contains the file set in the project.clj but it does not contain the JavaScript code I am expecting (all I see is goog. methods that have nothing to do with the file I want to convert).
My question is: What is the proper folder structure? Do I have to set my source path to e.g. "src/filename.clj"?
i think that you have to give a reading to the docs
https://github.com/clojure/clojurescript/wiki/Quick-Start
and this also will help you:
http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/