Do I have to use multiple builds here? like
(defproject lein-cljsbuild-example "1.2.3"
:plugins [[lein-cljsbuild "1.0.3"]]
:cljsbuild {
:builds [
{:source-paths ["src-cljs-main"]
:compiler {:output-to "main.js"}
{:source-paths ["src-cljs-other"]
:compiler {:output-to "other.js"}}]})
This will probably work, but it's a workaround.
Am Sonntag, 6. April 2014 18:42:25 UTC+2 schrieb Ivan Schuetz:
> I have a cljs file that depends on another. But the compiled script is
> inserting the scripts in the wrong order. So when this code tries to access
> some functionality which was initialized in the second file, it throws an
> error.
>
> How is the ordering determined? Is there any way to change this?
>
> These are my scripts. It's an AngularJS application.
>
> app.cljs - here I declare AngularJS module, which I'll retrieve in the
> other.cljs:
>
> (ns myapp.mainscript
> (:require [jayq.core :as jq])
> (:use [jayq.core :only [$]]
> [clojure.string :only [blank?]])
> )
>
> (let [app (-> js/angular
> (.module "myproj" ["myproj.controllers"]))])
>
>
> other.cljs:
>
> (ns myapp.other
> (:require [jayq.core :as jq])
> (:use [jayq.core :only [$]]
> [clojure.string :only [blank?]])
> )
>
>
> (def app (-> js/angular (.module "myproj")))
>
> (println app)
>
>
> This is generated JS - the first script is in the last line app_6414 = ...
>
> myapp.add_product_controller.app = angular.module("myproj");
> cljs.core.println.call(null, myapp.add_product_controller.app);
> myapp.mainscript = {};
> var app__6414 = angular.module("myproj",
> cljs.core.PersistentVector.fromArray(["myproj.controllers"], !0));
>
>
> For I moment I thought the ordering could be related to my use of variables
> "app", but these should be independent of each other.
>
> What's the problem here? how can I fix this?
--
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.