Coder Social home page Coder Social logo

dribba / sbt-typescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arpnetworking/sbt-typescript

0.0 1.0 0.0 628 KB

A plugin for SBT that uses sbt-web to compile typescript resources.

License: Apache License 2.0

Scala 55.07% JavaScript 29.13% TypeScript 15.81%

sbt-typescript's Introduction

sbt-typescript Build Status

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("com.arpnetworking" % "sbt-typescript" % "0.1.8")

You will also need to enable the SbtWeb plugin in your project.

The options provided mimic the arguments to the tsc command line compiler.

Option Description
sourceMap Generates source maps for input files.
sourceRoot Specifies the location where the compiler should locate TypeScript files instead of the source locations.
mapRoot Specifies the location where the compiler should locate map files instead of generated locations.
target ECMA script target version. Should be "ES3" or "ES5" (default).
noImplicitAny Warn on expressions and declarations with an implied "any" type.
moduleKind Specifies module code generation. Should be "" (default), "commonjs", or "amd".
outFile Concatenate and emit output to a single file.
outDir Destination directory for output files.
removeComments Removes comments from the generated source.

By default, all typescript files (*.ts) are included in the compilation and will generate corresponding javascript files. To change this, supply an includeFilter in the TypescriptKeys.typescript task configuration.

For example:

includeFilter in TypescriptKeys.typescript := "myFile.ts"

You can also set an exclude filter in the same way.

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 build.sbt file:

JsEngineKeys.engineType := JsEngineKeys.EngineType.Node

© Groupon Inc., 2014

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.