It’s very cumbersome to add  (:require [init]) manually to each file.

Is there another solution?


—
Sent from Mailbox

On Mon, Nov 10, 2014 at 4:43 PM, Thomas Heller <[email protected]>
wrote:

> 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 a topic in the Google 
> Groups "ClojureScript" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojurescript/mDI0HKfSrg4/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

-- 
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