boot-clj / boot-cljs

Boot task to compile ClojureScript programs.
Eclipse Public License 1.0
176 stars 40 forks source link

issues with modules in cljs task. Creates an empty file. #196

Open mariuene opened 5 years ago

mariuene commented 5 years ago

Hey. I have an issue with the cljs task.

Using the cljs compiler from adzerk/boot-cljs with the :modules option added, the modules will still be in the cljs_base.js file when compiled, and not in their own assigned files.

 :compiler-options {...
                    :modules {:app  {:output-to "bar/app/main.js"  
                                     :entries '#{test.app.main}}
                              :cool {:output-to "bar/cool/cool.js"
                                     :entries '#{test.cool.cool}}}}

When adding these compiler options to the cljs task, the assigned .js files for the modules will be created, but they will not contain any code.

Using these options directly with the cljs.build.api/build function will work as wanted.

I've set up a dummy project with some example code to display the bug https://github.com/mariuene/cljs-boot-modules-issue

mariuene commented 5 years ago

It seems to work for one module when you have a .cljs.edn file.

mariuene commented 5 years ago

I updated the dummy repo. Looks like when you have multiple .cljs.edn files and and you want to have a module for each, the only module that will be created is for the first .cljs.edn file in alphabetical order. The other(s) will be added to the base_cljs.js file.

DjebbZ commented 5 years ago

Is it still relevant since I managed to get it working ? Will show you and the rest of the team soon.

mariuene commented 5 years ago

I haven't really looked into this more, but if you have something that works I would be more than happy to have a look at it.