process(src, fileName) { // Make sure that source maps are always enabled and inline so that they // can be picked up by the `source-map-support` package. return tsc.transpileModule(src, { compilerOptions: compilerOptions, fileName: fileName, }).outputText; }
file.data = new Buffer(result.outputText); });
process(src, path) { const isTs = path.endsWith('.ts'); const isTsx = path.endsWith('.tsx'); const isTypescriptFile = (isTs || isTsx); if ( isTypescriptFile ) { return tsc.transpileModule( src, { compilerOptions: tsConfig.compilerOptions, fileName: path } ).outputText; } return src; }
const transformResult = babel.transform(tsResult.outputText, babelConfig);
const text = await fsReadFile(process.stdin.fd, 'utf-8'); const output = ts.transpileModule(text, { compilerOptions }); process.stdout.write(output.outputText);