在 ScalaJS sbt 插件中是否有任何选项可以禁用源映射生成?

Is there any options to disable source maps generation in ScalaJS sbt plugin?

我想为 fullOptJS(生产模式)禁用源映射生成。 拥有有关原始 Scala 源文件的所有信息并不总是合适的。

我没有找到任何合适的选项来完全禁用输出或类似的东西? 文档中是否有任何 link 包含可用于 scalajs sbt 插件的所有选项?

感谢您的帮助

sbt 设置 scalaJSLinkerConfig, of type StandardLinker.Config, contains all the options you can possibly give to the Scala.js linker, i.e., the thing that optimizes everything and emits a .js file. For some reason, Scaladoc refuses to display the comments on of the vals, although they exist in the source code

你可以看到那里有一个 val sourceMap: Boolean,它清楚地配置了链接器是否要发出源映射。您可以使用以下 sbt 咒语将其设置为 fullOptJS 中的 false,以放置在相关项目的 .settings(...) 中:

scalaJSLinkerConfig in (Compile, fullOptJS) ~= { _.withSourceMap(false) }

(另见 this answer about what ~= means in sbt