Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sourcemap path for ScalaJs #1390

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading