I am working with a TypeScript module structured like this:
let function test(){
//...
}
export default test;
My goal is for tsc
to compile it in the following way:
let function test(){
//...
}
module.exports = test;
However, upon compilation, it is transformed into this:
let function test(){
//...
}
exports.default = test;
This means I have to require it like this:
const test = require('xxx').default;
How can I resolve this issue?