javascriptclojurescriptcompojureringcljsbuild

Specify the ClojureScript file I want to include


How to specify which ClojureScript file to include in a particular page?

Let's say now I have two pages, home and login, and I want only the compiled js from (ns foo.home) to be included in the home page, and only the compiled js from (ns foo.login) to be included in the login page, how can I do this?

Or, is it a rule that the whole site must use one js file that is compiled by cljsbuild?


Solution

  • The compiler is optimized for generating one file per app. You could use multiple builds to do something like what you want, but you would have common code and blobs in both pages (builds), which is not optimal.