That SHOULD be handled via the dependency graph of your namespaces, that means 
if one namespace requires code from another to be loaded it should list it in 
its (:require ...) declaration. This way you ensure that it was loaded in the 
right order.

init.cljs:

(ns init)

(enable-console-print!)
..

something.cljs:

(ns something
  (:require [init]))


As for compilation I cannot speak for other tools (like lein-cljsbuild) but 
shadow-build [1] compiles in the mentioned order. As long as the (ns ..) 
declaration is correct I expect other tools to do the right thing too.

HTH,
/thomas

[1] https://github.com/thheller/shadow-build

On Monday, November 10, 2014 3:10:49 PM UTC+1, Yehonathan Sharvit wrote:
> In my project I have a file: init.cljs with initialization code.
> 
> For instance:
>     (enable-console-print!)
>    
> (extend-type js/RegExp  ;; allow regexp to be called 
> https://gist.github.com/alandipert/2346460
>     IFn
>     (-invoke ([this s] (re-matches this s))))
> 
> What is the best way to make sure init.cljs is compiled before the rest of 
> the project?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to