mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 01:03:03 +08:00
15 lines
408 B
JavaScript
15 lines
408 B
JavaScript
const tsc = require('typescript');
|
|
const tsConfig = require('../tsconfig.json');
|
|
|
|
// force the output to use commonjs modules required by jest
|
|
tsConfig.compilerOptions.module = 'commonjs';
|
|
|
|
module.exports = {
|
|
process(src, path) {
|
|
if (path.endsWith('.ts') || path.endsWith('.tsx')) {
|
|
return { code: tsc.transpile(src, tsConfig.compilerOptions, path, []) };
|
|
}
|
|
return { code: src };
|
|
},
|
|
};
|