Giter Club home page Giter Club logo

fly-typescript's Introduction

fly-typescript

Typescript plugin for Fly

Install

npm install fly-typescript --save-dev

Usage

exports.scripts = function * (fly) {
  yield fly.source('src/**/*.ts').typescript({
    jsx: 'React',
    target: 'ES5',
    sourceMap: true,
    removeComments: true
  }).target('dist/js');
}

API

.typescript(options)

Unlike most plugins, this plugin provides access to all of Typescript's Transpile options. However, for the sake of simplicity, this plugin flattens all compilerOptions keys into the same object. In other words, we assume that you're providing compilerOptions, unless the given key matches the name of another TranspileOption.

Check out Typescript's Compile Options to see all Compiler options.

For example:

fly.source('...').typescript({ 
  moduleName: 'FooBar',
  compilerOptions: {
    module: 'System',
    sourceMap: true
  }
}).target('...');

// can be written as:

fly.source('...').typescript({ 
  moduleName: 'FooBar',
  module: 'System',
  sourceMap: true
}).target('...');

Notice that compilerOptions is no longer defined, and instead, its children (module, sourceMap, etc) are defined alongside moduleName!

Note: The first example (aka, using compilerOptions) will still work.

License

MIT © FlyJS

fly-typescript's People

Contributors

cjthompson avatar iiegor avatar leesiongchan avatar lukeed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fly-typescript's Issues

"Debug Failure. False expression: Output generation failed"

If the source files include any type declaration files, like src/@types/my-modules/index.d.ts, the result is:

[15:08:25] Starting scripts
[15:08:25] scripts failed because Debug Failure. False expression: Output generation failed
[15:08:25] Task chain was aborted!

It took a while to figure this out. If I change the code to:

yield fly.source(['src/**/*.ts', '!src/@types/**/*']).typescript().target('dist');

then it will work.

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.