Allows TypeScript to be used from within sbt. Leverages the functionality of com.typesafe.sbt:js-engine to run the typescript compiler.
To use this plugin use the addSbtPlugin command within your project's plugins.sbt (or as a global setting) i.e.:
addSbtPlugin("eu.sipria.sbt" % "sbt-typescript" % "0.6.0") resolvers += Resolver.typesafeRepo("releases")
You will also need to enable the SbtWeb plugin in your project.
The supported sbt settings are:
|configFile||By default the sbt-typescript will look into the assets directory (app/assets/tsconfig.json). If you want sbt-typescript look into the root folder, just set this property to 'yourconfigname.json'|
|sourceRoot||Specifies the location where debugger should locate TypeScript files instead of source locations.|
include and exclude, baseUrl properties of tsconfig are not supported.
For including specific files of your project you can write something like:
includeFilter in (Assets, typescript) := GlobFilter("myFile.ts")
You can also set an exclude filter in the same way:
excludeFilter in (Assets,typescript) := GlobFilter("*.d.ts") | GlobFilter("*.spec.ts") | GlobFilter("**/typings")
A note on typescript compiling speed
Sometimes the default engine (Trireme) can be quite slow. If you're experiencing long typescript compile times you can always switch to node.js (remember to install it first) adding this line to your
JsEngineKeys.engineType := JsEngineKeys.EngineType.Node