Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

change default tsc options. use `--target es6 --module commonjs --exp… #15

Merged
merged 2 commits into from
Feb 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/tsc/Tsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {ITscExecOptions} from './ITscExecOptions';

export default class Tsc {
static useJsx = /\.tsx$/i;
static useEs6 = /\.es6\.tsx?$/i;

public static run(tsfile: string, options: ITscExecOptions): Promise<exec.ExecResult> {
let tscPath = options.tscPath;
Expand All @@ -34,13 +33,10 @@ export default class Tsc {
}
return util.fileExists(tsfile + '.tscparams');
}).then(tsParamsExist => {
let command = 'node ' + tscPath + ' --module commonjs ';
let command = 'node ' + tscPath + ' --target es6 --module commonjs --experimentalDecorators ';
if (Tsc.useJsx.test(tsfile)) {
command += '--jsx react ';
}
if (Tsc.useEs6.test(tsfile)) {
command += '--target es6 ';
}
if (options.useTscParams && tsParamsExist) {
command += '@' + tsfile + '.tscparams';
}
Expand Down