You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sbt-scala-js-map is a Sbt plugin that configures source mapping for Scala.js projects hosted on Github.
Motivation
I have some Scala.js libraries hosted on Github (Binding.scala and some private libraries). Then, other Scala.js applications would depend on these libraries. When I debug the Scala.js application in a browser, I want to see the Scala source files of the original libraries.
However, by default, the generated *.js.map files maps the generated JavaScript to the absolute Scala source path where the original library compiled. For me, the path is on a Travis CI worker, like /home/travis/build/ThoughtWorksInc/.../Binding.scala. The path obviously does not exist on my local computer that debugs the application. Too bad.
This sbt plugin detects if a library is hosted on Github repository and let source map point to https://raw.githubusercontent.com/ instead of a local file path.
Execute the release command if you have setup sbt-release correctly。
sbt release
Step 3: Debug it!
Now switch your Scala.js application to the newly published Scala.js library, build it, browse your web page, and open the debugger in your browser. You will see the Scala source files hosted under https://raw.githubusercontent.com/ and you can set break points at code lines in these Scala files.
About
A Sbt plugin that configures source mapping for Scala.js projects hosted on Github