A really simple sbt plugin for running npm (or yarn) tasks as part of sbt build process
- sbt 0.13.6+
Add the following lines to your plugins.sbt
//autoplugin
addSbtPlugin("io.shaka" % "sbt-npm" % "8")
Usage
sbt npm [some command]
e.g. sbt "npm --version"
or sbt-prompt> npm --version
This will run the command 'npm --version' in the project default working directory '.'
Setting to specify location of the npm executable
npmExec := "/usr/local/bin/npm"
Setting working directory for npm
npmWorkingDir := "src/main/elm"
Setting npm commands to run as part of the compile phase
npmCompileCommands := "run build"
Setting npm commands to run as part of the compile phase
npmTestCommands := "run test"
Setting npm commands to run as part of the clean phase
npmTestCommands := "run clean"
To use yarn instead of npm set the npmExec setting to the location of yarn
e.g. nmpExec := "/usr/local/bin/yarn"
Apache License 2.0