dyno-bot/Dyno-core-op8resolve/preprocessor.js

16 lines
318 B
JavaScript
Raw Normal View History

2020-09-12 20:08:48 +02:00
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;
},
};