Socket
Book a DemoInstallSign in
Socket

@taskr/typescript

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taskr/typescript

Compile Typescript with Taskr.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

@taskr/typescript npm

Compile Typescript with Taskr.

Install

$ npm install --save-dev @taskr/typescript

Usage

exports.scripts = function * (task) {
  yield task.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:

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

// can be written as:

task.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.

Support

Any issues or questions can be sent to the Taskr monorepo.

Please be sure to specify that you are using @taskr/typescript.

License

MIT © Luke Edwards

Keywords

taskr

FAQs

Package last updated on 27 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts