whether to enable the “reload workflow” for webpack in fastOptJS.
whether to enable the “reload workflow” for webpack in fastOptJS.
When enabled, dependencies are pre-bundled so that the output of fastOptJS can directly
be executed by a web browser without being further processed by a bundling system. This
reduces the delays when live-reloading the application on source modifications. Defaults
to true.
Note that the “reload workflow” does not use the custom webpack configuration file, if any.
List of the NPM packages (name and version) your application depends on.
List of the NPM packages (name and version) your application depends on. You can use [semver](https://docs.npmjs.com/misc/semver) versions:
npmDependencies in Compile += "uuid" -> "~3.0.0"
Note that this key must be scoped by a Configuration (either Compile or Test).
Map of NPM packages (name -> version) to use in case transitive NPM dependencies refer to a same package but with different version numbers.
Map of NPM packages (name -> version) to use in case transitive NPM dependencies refer to a same package but with different version numbers. In such a case, this setting defines which version should be used for the conflicting package. Example:
npmResolutions in Compile := Map("react" -> "15.4.1")
If several Scala.js projects depend on different versions of react, the version 15.4.1
will be picked. But if all the projects depend on the same version of react, the version
given in npmResolutions will be ignored.
Note that this key must be scoped by a Configuration (either Compile or Test).
Fetches NPM dependencies.
Fetches NPM dependencies. Returns the directory in which the npm install command has been run.
The plugin uses different directories according to the configuration (Compile or Test). Thus,
this setting is scoped by a Configuration.
Typically, if you want to define a task that uses the downloaded NPM packages you should
specify the Configuration you are interested in:
myCustomTask := {
val npmDirectory = (npmUpdate in Compile).value
doSomething(npmDirectory / "node_modules" / "some-package")
}The task returns the directory in which the dependencies have been fetched (the directory
that contains the node_modules directory).
Whether to use Yarn to fetch dependencies instead
of npm.
Whether to use Yarn to fetch dependencies instead
of npm. Yarn has a caching mechanism that makes the process faster.
If set to true, it requires the yarn command to be available in the
host platform.
Defaults to false.
Bundles the output of a Scala.
Bundles the output of a Scala.js stage.
This task must be scoped by a Scala.js stage (either fastOptJS or fullOptJS) and
a Configuration (either Compile or Test).
For instance, to bundle the output of fastOptJS, run the following task from the sbt shell:
fastOptJS::webpack
Or, in an sbt build definition:
webpack in (Compile, fastOptJS)
Note that to scope the task to a different project than the “current” sbt project, you have to write the following:
webpack in (projectRef, Compile, fastOptJS in projectRef)
The task returns the produced bundles.
configuration file to use with webpack.
configuration file to use with webpack. By default, the plugin generates a configuration file, but you can supply your own file via this setting. Example of use:
webpackConfigFile in fullOptJS := Some(baseDirectory.value / "my.prod.webpack.config.js")
You can find more insights on how to write a custom configuration file in the cookbook.
whether to enable (or not) source-map in
a given configuration (Compile or Test) and stage (fastOptJS or fullOptJS).
whether to enable (or not) source-map in
a given configuration (Compile or Test) and stage (fastOptJS or fullOptJS). Example
of use:
webpackEmitSourceMaps in (Compile, fullOptJS) := falseNote that, by default, this setting takes the same value as the Scala.js’ emitSourceMaps
setting, so, to globally disable source maps you can just configure the emitSourceMaps
setting:
emitSourceMaps := falseList of entry bundles to generate.
List of entry bundles to generate. By default it generates just one bundle for your main class.