Scala.js 0.6.13 onwards
Put this in your build file:
scalaJSModuleKind := ModuleKind.CommonJSModule
Scala.js 0.6.5-0.6.12
Put this in your build file (explanation below):
scalaJSOutputWrapper := ("var __ScalaJSEnv = { exportsNamespace: exports };", "")
Scala.js 0.5.4 to 0.6.4
You can tell Scala.js where to send the exported material. To create a CommonJS module, simply add this:
var __ScalaJSEnv = { exportsNamespace: exports };
to the .js file created by fastOptJS / fullOptJS .
Pre Scala.js 0.5.4
Please update :)
source share