I have this in a TS file:
exports.default = module.exports;
(This is to support both Node style and TS style imports.)
Is there a way to create the above line of code with pure TS instead of JS?
I tried this:
export default const = module.exports;
and that does not transpile.
Somewhat counterintuitively, the answer appears to be:
export default module.exports;
that's it.
however, in order to get any .d.ts files to behave correctly, you actually are best off doing this:
let $exports = module.exports;
export default $exports;
you can read about this here: https://github.com/Microsoft/TypeScript/issues/16442
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With