taskr icon indicating copy to clipboard operation
taskr copied to clipboard

@taskr/typescript support for tsconfig.json

Open mtoso opened this issue 7 years ago • 1 comments

Hi, thanks for this project. I was wondering if there is a way to use the options for the typescript compiler coming from the tsconfig.json.

mtoso avatar Apr 02 '18 18:04 mtoso

Hey, thanks~! Right now the plugin is only expecting programmatic options, which correlate to the Compiler Options.

If you wanted to use an existing tsconfig.json file, you can parse it at the beginning of your TS task and send along the right pieces.

export async function scripts(task) {
  let data = require('./tsconfig');
  // If using tsconfig for "source" you must handle that on your own
  let files = data.files.map(handler) || 'src/**/*.ts';
  await task.source(files).typescript(data.compilerOptions).target('...');
}

lukeed avatar Apr 02 '18 18:04 lukeed