Skip to content

tagtog/sbt-babel

 
 

Repository files navigation

sbt-babel Build Status

An SBT plugin to perform Babel compilation.

Installation

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"
  }
}

Usage

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"]
}

Packages

No packages published

Languages

  • Scala 68.1%
  • JavaScript 31.9%