An SBT plugin to perform Babel compilation.
To use this plugin use the addSbtPlugin command within your project's plugins.sbt
file:
addSbtPlugin("io.teamscala.sbt" % "sbt-babel" % "1.1.2")
Your project's build file also needs to enable sbt-web plugins. For example with build.sbt
:
lazy val root = (project in file(".")).enablePlugins(SbtWeb)
JsEngineKeys.engineType := JsEngineKeys.EngineType.Node
Install babel-core, either globally with npm:
npm install babel-core -g
Or locally in your project with a package.json
file:
{
"devDependencies": {
"babel-core": "^6.26.0",
"[If you needed more...]",
"babel-preset-stage-0"
}
}
For example with build.sbt
:
BabelKeys.options := WebJs.JS.Object(
"presets" -> List("stage-0")
// More options ...
)
Or locally in your project with a .babelrc
file:
{
"presets": ["stage-0"]
}