-
-
Save swannodette/8775213 to your computer and use it in GitHub Desktop.
(defproject cljs-gwt "0.1.0-SNAPSHOT" | |
:description "FIXME: write this!" | |
:url "http://example.com/FIXME" | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[org.clojure/clojurescript "0.0-2138"] | |
[compojure "1.0.4"] | |
[hiccup "1.0.0"]] | |
:plugins [[lein-cljsbuild "1.0.1"] | |
[lein-ring "0.7.0"]] | |
:ring {:handler cljs-gwt.core/app} | |
:source-paths ["src/clj"] | |
:cljsbuild { | |
:builds [{:id "dev" | |
:source-paths ["src/cljs"] | |
:compiler { | |
:output-dir "resources/public/js/out/" | |
:output-to "resources/public/js/cljs_gwt.js" | |
:source-map true | |
:optimizations :none}} | |
{:id "prod" | |
:source-paths ["src/cljs"] | |
:compiler { | |
:output-to "resources/public/js/cljs_gwt.js" | |
:optimizations :advanced}}]}) |
@hsestupin, I've tweaked :output-dir
. Also worth taking a look at https://github.com/magomimmo/cljs-start, I'm pretty sure they've solved the configuration problem.
And of course before trying your option I made "lein cljsbuild clean"
@hsestupin, actually you don't need to set :source-map-path
since source maps are produced for every single file.
; The optimization level. May be :whitespace, :simple, or :advanced.
; Defaults to :whitespace.
:optimizations :whitespace
It's from "lein cljsbuild sample". And there is nothing said about :none option. Don't know why, but {:optimization :whitespace} generates working file-structure and sorce maps works well with that
I'm finding the same thing happening to me. :optimizations :whitespace
generates the correct file and file structure. But :optimizations :none
was giving me this error.
It's not working also with the same browser error "Uncaught ReferenceError: goog is not defined".
It raises because lein-cljsbuild generates the following file structure:
resources/public/js/goog/ ...
resources/public/js/cljs_gwt/ ...
resources/public/js/cljs/ ...
resources/public/js/cljs_gwt.js
and cljs_gwt.js contains the only following strings:
goog.addDependency("base.js", ['goog'], []);
goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.StringBuffer']);
goog.addDependency("../cljs_gwt/core.js", ['cljs_gwt.core'], ['cljs.core']);
So in fact "goog" object is really undefined within such generated file structure. Hope my explanation is clear.