boot-clj / boot-cljs

Boot task to compile ClojureScript programs.
Eclipse Public License 1.0
176 stars 40 forks source link

It tries to load a `/main.out/goog/base.js` #137

Closed zilti closed 8 years ago

zilti commented 8 years ago

I have a really quite simple setup. I've set my cljs-src-directory using :source-paths, placed my main.cljs.edn where I want the output .js to be, and have put (cljs), without any arguments, into my command chain. The compilation works flawlessly without any warnings or errors.

But when I include it, it seems to request /main.out/goog/base.js and /main.out/cljs_deps.js while loading (and obviously fails). Why does it do that? I thought cljs compiles everything into one file?

Deraen commented 8 years ago

I thought cljs compiles everything into one file?

No. In development mode it will output a output file per namespace (and per used closure module), plus some additional files. Without knowing more, those paths seem correct.

Depending on what is the path you are serving files from, you might need to set asset-path option manually: https://github.com/Deraen/saapas/blob/master/src/cljs/js/main.cljs.edn#L2

zilti commented 8 years ago

Ok. Asset-path is, I guess, a relative path to where I want the directory main.out to be?

Deraen commented 8 years ago

https://github.com/clojure/clojurescript/wiki/Compiler-Options#asset-path

zilti commented 8 years ago

This indeed corrected the link, but it still can't find the file now named /data/js/goog/base.js (the path of the main.js being data/js/main.js, and that one is found)

zilti commented 8 years ago

ahh, it creates the main.out directory inside the asset-path. :) Thanks!

martinklepsch commented 8 years ago

Can this be closed?