Let's say I have two pages that contain a lot of code, a lot of libraries, etc., but have some differences. For a specific example, I turn on jQuery and on each page there is another function in the "finished document" (aka $(function() { ... }) ).
With JS, that would be easy. I would include jQuery on each page and on each page should have a different <script> snippet or include script-behind-page-A.js in pageA.html and script-behing-page-B.js in pageB.html .
How can I achieve the same result using ClojureScript?
I suspect that the compilation output is so great that it is best to have one big javascript ball emitted by the compiler. In this case, he clearly cannot have two different “finished documents”.
Is the proposed thread so that the code contains mainly functions that allow you to do something, initialize several state variables and initialize each page individually using simple JS as needed?
source share