I'm trying to handle my JS dependencies with scalajs-bundler for my Scala.js project. It successfully downloads my dependency (d3.js), but I don't know how to include my code and the dependency in my HTML file.
I tried every files I found on target/scala-2.12/ but it didn't work.
- with
target/scala-2.12/*-jsdeps.jsit doesn't run my main method. - with
target/scala-2.12/scalajs-bundler/main/*-fastopt.jsI getReferenceError: exports is not definedin Firefox.
I don't want to use a facade, this is a short-term project and I plan to use js.Dynamic.
A side question: can I still use source maps with scalajs-bundler ?
Thanks.
Ok, the problem was that the final bundle file
*-fastopt-bundle.js(the one to include) was missing, and apparently it was because webpack was silently unable to run because npm packages are referring tonode(and notnodejs) in their shebang.So the solution was to install
nodejs-legacyon Ubuntu.