1

I would like to disable source maps generation for fullOptJS (production mode). It is not always appropriate to have all the information about original Scala source files.

I didn't find any suitable options to disable output entirely or something similar? Is there any link to the documentation with all the options available for scalajs sbt plugin?

Thanks for any help

abdolence
  • 2,369
  • 1
  • 21
  • 29

1 Answers1

5

The sbt setting 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.

You can see there a val sourceMap: Boolean, which clearly configures whether the linker is going to emit source maps. You can set it to false in fullOptJS with the following sbt incantation, to be placed in the .settings(...) of the relevant project:

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

(see also this answer about what ~= means in sbt)

sjrd
  • 21,805
  • 2
  • 61
  • 91