When I see the compiled code by Babel, they do not seem to be equivalent.
Actually, the former transforms to exports.A = A, which is not equivalent to mod
You can use
export default class A {
}
Or
class A {
}
export default A;
Which will export as
exports["default"] = A;
module.exports = exports["default"];
There's an explanation why in the interop section here.
In order to encourage the use of CommonJS and ES6 modules, when exporting a default export with no other exports
module.exportswill be set in addition toexports["default"].