start-typescript
Version: 
81 lines (62 loc) • 2.92 kB
Markdown
[](https://www.npmjs.com/package/start-typescript)
[](https://circleci.com/gh/effervescentia/start-typescript)
[](https://ci.appveyor.com/project/effervescentia/start-typescript)
[](https://codecov.io/github/effervescentia/start-typescript)
[](https://david-dm.org/effervescentia/start-typescript)
[](https://github.com/semantic-release/semantic-release)
[](http://commitizen.github.io/cz-cli/)
[](https://greenkeeper.io/)
:abc: Typescript compilation task for [Start](https://github.com/start-runner/start)
```sh
npm install --save-dev start-typescript
yarn add --dev start-typescript
```
```js
import Start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import read from 'start-read';
import write from 'start-write';
import typescript from 'start-typescript';
const start = Start(reporter());
export const task = () => start(
  files('lib/index.ts'), // must reference a single entrypoint
  read(),
  typescript(),
  write('build/')
);
```
```js
import Start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import read from 'start-read';
import write from 'start-write';
import split from 'start-split';
import mocha from 'start-mocha';
import typescript from 'start-typescript';
const start = Start(reporter());
export const task = () => start(
  files('test/index.ts'), // must reference a single entrypoint
  read(),
  typescript(),
  split({
    lib: () => [write('.scratch/lib')],
    test: () => [write('.scratch/test')]
  }),
  files('.scratch/test/**/*.js'),
  mocha()
);
```
This task relies on `[{ path, data, map }]` input and provides the same, see [documentation](https://github.com/start-runner/start#readme) for details.
`typescript(opts)`
*   `opts`
    *   `configFile` - path to an alternate `tsconfig.json`
    *   `compilerOptions` - tsconfig `compilerOptions` as specified
        [](http://www.typescriptlang.org/docs/handbook/compiler-options.html)