mill.scalajslib.config

Members list

Type members

Classlikes

Allows to compile Scala.js code with advanced configuration options

Allows to compile Scala.js code with advanced configuration options

This module allows to compile Scala.js code, like ScalaJSModule, but also allows to configure the Scala.js linker using Scala.js' own API. It also allows to specify custom module initializers.

== How to use ==

Add dependencies towards Mill's scalajslib-config module and Scala.js' linker and js-envs modules in your meta-build, in mill-build/build.mill, like

import mill._
import mill.scalalib._

object `package` extends mill.meta.MillBuildRootModule {

 def scalaJSVersion = "1.20.2" // Put here the Scala.js version you'd like to use

 def mvnDeps = Seq(
   mvn"com.lihaoyi::mill-libs-scalajslib-config-1:${mill.api.BuildInfo.millVersion}",
   mvn"org.scala-js:scalajs-linker_2.13:$scalaJSVersion",
   mvn"org.scala-js:scalajs-js-envs_2.13:1.4.0"
 )
}

Then use ScalaJSConfigModule instead of ScalaJSModule when defining a Scala.js module. Beware that scalaJSVersion must not be overridden: the Scala.js version is specified in the meta-build like illustrated above.

Keep in mind that adding the Scala.js linker or js-env modules in the meta-build like above effectively prevents the use of other Scala.js versions in your whole build, even when using ScalaJSModule directly and specifying another Scala.js version.

Attributes

Source
ScalaJSConfigModule.scala
Supertypes
trait ScalaModule
trait JavaModule
trait RunModule
trait RunModuleApi
trait BspModule
trait BspModuleApi
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type