pkozlowski-opensource / rollup-plugin-typescript

Seamless integration between Rollup and Typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rollup-plugin-typescript

travis-ci

Seamless integration between Rollup and Typescript.

Why?

See rollup-plugin-babel.

Installation

npm install --save-dev rollup-plugin-typescript

Usage

// rollup.config.js
import typescript from 'rollup-plugin-typescript';

export default {
  entry: 'main.ts',

  plugins: [
    typescript()
  ]
}

All options are as per the Typescript's Compiler Options, except options.include and options.exclude (each a minimatch pattern, or array of minimatch patterns), which determine which files are transpiled by Typescript (by default, all files are transpiled).

Issues

TypeScript 1.6.2 isn't able to transpile to ES5 while preserving ES2015 modules. That's why we use a prerelease of TypeScript 1.7.0 for ease of use. 🚀 This option can be easily be overridden.

// rollup.config.js
import typescript from 'rollup-plugin-typescript';
import * as ts from 'typescript';

export default {
  entry: 'main.ts',

  plugins: [
    typescript({
      target: ts.ScriptTarget.ES6
    })
  ]
}

License

MIT

About

Seamless integration between Rollup and Typescript


Languages

Language:JavaScript 91.1%Language:TypeScript 8.9%