Skip to content

Commit

Permalink
dev: fix sourcemap path for scalajs (#1390)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kaleja <[email protected]>
  • Loading branch information
kalejami and Michael Kaleja authored Jan 10, 2025
1 parent 7150680 commit 68fcdf6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ lazy val commonSettings = crossVersionSharedSources ++ Seq(
)
)

lazy val jsSourceMapSettings = Def.settings(
scalacOptions += {
val tagOrHash =
if (!isSnapshot.value) s"v${version.value}"
else git.gitHeadCommit.value.getOrElse("main")
val local = (LocalRootProject / baseDirectory).value.toURI.toString
val remote = s"https://raw.githubusercontent.com/milessabin/shapeless/$tagOrHash/"
val opt = "-P:scalajs:mapSourceURI"
s"$opt:$local->$remote"
}
)

def configureJUnit(crossProject: CrossProject) = crossProject
.jvmSettings(libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % "test")
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
Expand Down Expand Up @@ -147,7 +159,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(macroAnnotationSettings)

lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val coreJS = core.js.settings(jsSourceMapSettings)
lazy val coreNative = core.native

lazy val scratch = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand Down

0 comments on commit 68fcdf6

Please sign in to comment.