In my project.clj file (fig.1), cljsbuild config just points to the parent
source-path. Now, I plan to have *file1.cljs* in a different directory than
*file2.cljs*. But what I'm finding in this case, is that compiled
*file1js*is getting it's calls glommed into
*main.js*. So for example in fig.1 & 2, edgar.js and the bottom of main.js
are exactly the same. So I can't really include both of them in the same
HTML page. I'm hoping there's a way to leave out the bottom of main.js.
Removing the :optimizations flag doesn't do it. And having different
directories, again, will separate user files, but not the cljs compiler
generated main.js.

    :cljsbuild {
                :builds [{
                          :incremental true
                          *:source-path "public/templ/cljs"*
                          :compiler {
                                     *:output-to
"public/javascript/main.js" *
                                     :output-dir "public/javascript/"
                                     :optimizations :whitespace
                                     :pretty-print true}}]}

*fig.1 - project.clj*

...
}();
goog.provide("edgar");
goog.require("cljs.core");
goog.require("shoreleave.remotes.http_rpc");
goog.require("clojure.browser.repl");
shoreleave.remotes.http_rpc.remote_callback.call(null, "\ufdd0'heartbeat",
cljs.core.PersistentVector.fromArray(["heartbeat"], true),
function(p1__2853_SHARP_) {
  return alert(p1__2853_SHARP_)
});

*fig.2 - main.js*

goog.provide('edgar');

goog.require('cljs.core');
goog.require('shoreleave.remotes.http_rpc');
goog.require('clojure.browser.repl');
shoreleave.remotes.http_rpc.remote_callback.call(null,"\uFDD0'heartbeat",cljs.core.PersistentVector.fromArray(["heartbeat"],
true),(function (p1__2853_SHARP_){
return alert(p1__2853_SHARP_);
}));

*fig.3 - edgar.js *


Hmm
Tim


On Tue, May 7, 2013 at 12:32 PM, David Nolen <dnolen.li...@gmail.com> wrote:

> This is why I suggested organizing the project around directories and
> specifying different groups of them with different lein-cljsbuild groups.
>
>
> On Tue, May 7, 2013 at 12:24 PM, Jonathan Fischer Friberg <
> odysso...@gmail.com> wrote:
>
>> I haven't used clojurescript in a while, but if I recall correctly, the
>> only way
>> to not compile everything into a single file is to leave out the
>> :optimization flag
>> completely. If this is the case this should probably be considered a bug.
>> I might
>> be wrong though.
>>
>> Jonathan
>>
>>
>> On Tue, May 7, 2013 at 5:49 PM, David Nolen <dnolen.li...@gmail.com>wrote:
>>
>>> I believe the ClojureScript compiler simply looks for all .cljs files on
>>> the specified compile path. I think maybe you could put your files in
>>> different directories so they don't all get concatenated together. You can
>>> one build specify one path, and another build specify both paths.
>>>
>>> Perhaps other people have better solutions?
>>>
>>>
>>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to