I realize it's much better if I give the complete configuration.
latest ClojureScript stable 1.10.516
deps.edn alias: {:cljs {:main-opts ["-m" "cljs.main" "-co" "cljs-dev.edn"
"--compile"]}}
cljs-dev.edn file:
{:main "my-app.core"
:parallel-build true
:optimizations :simple
:output-dir "target/js"
:modules {:cljs-base {:output-to "target/js/main.js"
:source-map true}
:page1 {:entries #{"my-app.layout.page1"}
:output-to "target/js/page1.js"
:source-map true}
:page2 {:entries #{"my-app.layout.page2"}
:output-to "target/js/page2.js"
:source-map true}
:page3 {:entries #{"my-app.layout.page3"}
:output-to "target/js/page3.js"
:depends-on #{:components1}
:source-map true}
:page4 {:entries #{"my-app.layout.page4"}
:output-to "target/js/page4.js"
:depends-on #{:components1 :components2}
:source-map true}
:page5 {:entries #{"my-app.layout.page5"}
:output-to "target/js/page5.js"
:depends-on #{:components1 :components2}
:source-map true}
:components1 {:entries
#{"my-app.components.common.components1"}
:output-to "target/js/components1.js"
:source-map true}
:components2 {:entries
#{"my-app.components.common.components2"}
:output-to "target/js/components2.js"}}
}
So my point here is to remove code from cljs-base that is common to some
pages but not all of them and putting them into the split :components1 and
:components2. The compilation works, the split are good (I verified the
javascript produced for every file) but the runtime behavior is incorrect.
My problem is that when I load :page3 with (loader/load :page3
my-callback), I see a requests to components1.js with response 200 OK, but
no request to page3.js after, and my-callback is not executed.
On Friday, February 1, 2019 at 1:01:33 PM UTC+1, Khalid Jebbari wrote:
>
> Hello,
>
> I create 3 modules in the :modules configuration, say :cljs-base, :a & :b,
> and know that module :a depends on code in the module :b (and in :cljs-base
> of course). If I manually load only :a with `(cljs.loader/load :a)`, will
> it automatically load :b? My local testing seems to show that it doesn't.
>
>
--
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 https://groups.google.com/group/clojurescript.