Giter Club home page Giter Club logo

broccoli-typescript-incremental's Introduction

Gives broccoli typescript powers. Incrementally.

Why?

  • Bring Your Own TypeScript (>= 1.5 supported)
  • (Theoretical) Incremental build support. This only works for serve and timepiece. CachePath persistence is not yet supported by broccoli between separate executions (see broccolijs/broccoli#282).
  • Passthrough features. If you want to preserve all files and the folder structure, this will do that.
    • Without passthrough, all non .ts files will be ignored.
    • Note that this is implemented by simply copying the folder first.

Usage

First, install broccoli, then typescript.

npm install broccoli-cli -g
npm install typescript broccoli --save-dev

Next, create your brocfile.js.

var compileTypescript = require('broccoli-typescript-incremental');

var srcDir = 'your/path/to/src';
var TypescriptTree = compileTypescript(srcDir, {
  sourceMap: true,
  passthrough: true
  //Any typescript compiler options go here.
  //See http://json.schemastore.org/tsconfig
});

module.exports = TypescriptTree;

Finally, run broccoli. Note that incremental build does not work here.

broccoli build dist/

For incremental build, use broccoli-timepiece instead.

broccoli-timepiece dist/

This puts a watch on the folder - rebuilding is done automatically and the cache is used.

Limitations

All files used for compilation must be passed into the broccoli tree for compilation. In particular, take special note of the typescript definitions.

In particular, the "Could not find file in cache" error is related to this.

Future work

  • Manage file dependencies. When the build process gets sufficiently slow, to rewrite .ts dependencies and replace with preprocessed .ts.d. files which only get rebuilt when required.

broccoli-typescript-incremental's People

Contributors

blackening avatar conartist6 avatar

Watchers

 avatar  avatar

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.