Files
react-diagrams/tests/helpers/tsx-preprocessor.js
2017-11-21 00:39:19 +02:00

11 lines
271 B
JavaScript

const tsc = require('typescript');
const tsConfig = require('../../tsconfig.json');
module.exports = {
process(src, path) {
if (path.endsWith('.ts') || path.endsWith('.tsx')) {
return tsc.transpile(src, tsConfig.compilerOptions, path, []);
}
return src;
},
};