bensu / doo

doo is a library and lein plugin to run cljs.test on different js environments.
Eclipse Public License 1.0
324 stars 63 forks source link

add support for :foreign-libs #162

Closed gmp26 closed 6 years ago

gmp26 commented 6 years ago

It's not clear how to make the new compiler :foreign-libs option work in a lein doo phantom test run.

For example in project.clj:

 :foreign-libs  [{:file        "src/js/predict2model.js"
                                                :provides    ["js.predict2model"]
                                                :module-type :es6}]

where src/js/predict2model.js has the line

goog.provide('js.predict2model');

we get the error

TypeError: undefined is not an object (evaluating 'goog.provide')

But where should this be declared?

Also, if there's a :global-options key, lein-doo throws a wobbly.

miikka commented 6 years ago

Doo doesn't do anything special with the :foreign-libs so I believe it should work out of the box. To me this looks more like ClojureScript configuration problem more than Doo problem. ClojureScript's documentation is the best reference for this:

Unfortunately, I'm not able to reproduce your problem with Doo and ClojureScript 1.9.946. Furthermore, I'm not 100% sure I understand what's your goal since your predict2model.js is a Google Closure module, but you have specified :module-type :es6.

I'm going to close this issue, but if you need more help, I recommend joining the #clojurescript channel on Clojurians slack and asking there. You can get invite here


The :global-options should be solved by #172 which will be included in the next release.