antd-tools icon indicating copy to clipboard operation
antd-tools copied to clipboard

Should stop transpiling to wrong default export syntax

Open buhichan opened this issue 6 years ago • 3 comments

Related: https://github.com/ant-design/ant-design/issues/11263 https://github.com/babel/babel/issues/2212

Should stop using babel-plugin-add-module-exports Should stop transpiling to wrong module syntax

Should use babel-plugin-add-module-exports@next and turn on addDefaultProperty option.

buhichan avatar Jul 13 '18 08:07 buhichan

We've tried to remove babel-plugin-add-module-exports, unfortunately, it's a breaking change.

yesmeck avatar Jul 17 '18 03:07 yesmeck

I think you can make it backward compatible by make module and module.default both refers to the same thing.


[email protected] (not published currently) has this option:

addDefaultProperty This will cause a second line of code to be added which aliases the default name to the exported object like so:

module.exports = exports['default'];
module.exports.default = exports['default']

buhichan avatar Jul 18 '18 03:07 buhichan

Any movement with this? @yesmeck

jch254 avatar Jan 19 '19 06:01 jch254