Skip to content

Commit 6adaa1c

Browse files
joroKr21kalejamiMichael Kaleja
authored
dev: fix sourcemap path for scalajs (#1390) (#1395)
Co-authored-by: kalejami <[email protected]> Co-authored-by: Michael Kaleja <[email protected]>
1 parent e8de604 commit 6adaa1c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build.sbt

+13-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ lazy val commonSettings = crossVersionSharedSources ++ Seq(
112112
)
113113
)
114114

115+
lazy val jsSourceMapSettings = Def.settings(
116+
scalacOptions += {
117+
val tagOrHash =
118+
if (!isSnapshot.value) s"v${version.value}"
119+
else git.gitHeadCommit.value.getOrElse("main")
120+
val local = (LocalRootProject / baseDirectory).value.toURI.toString
121+
val remote = s"https://raw.githubusercontent.com/milessabin/shapeless/$tagOrHash/"
122+
val opt = "-P:scalajs:mapSourceURI"
123+
s"$opt:$local->$remote"
124+
}
125+
)
126+
115127
def configureJUnit(crossProject: CrossProject) = crossProject
116128
.jvmSettings(libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % "test")
117129
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
@@ -161,7 +173,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
161173
.settings(macroAnnotationSettings)
162174

163175
lazy val coreJVM = core.jvm
164-
lazy val coreJS = core.js
176+
lazy val coreJS = core.js.settings(jsSourceMapSettings)
165177
lazy val coreNative = core.native
166178

167179
lazy val scratch = crossProject(JSPlatform, JVMPlatform, NativePlatform)

0 commit comments

Comments
 (0)