17 lines
319 B
JavaScript
17 lines
319 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;
|
|
},
|
|
};
|