ts-add-module-exports
v1.0.0
Published
Adds `module.exports = exports['default'];` for `exports.default`, for CommonJS default export interoperability.
Downloads
154
Readme
ts-add-module-exports
Adds module.exports = exports['default'];
for exports.default
, for CommonJS default export interoperability.
The TypeScript compiler transforms
export default main;
into
exports.default = main;
So, node consumers would have to do
require("./main").default
instead of
require("./main")
This script adds module.exports = exports['default'];
if only the exports.default
expression exists.
Like babel-plugin-add-module-exports, but for a TS build.