babel-plugin-dynamic-import-webpack icon indicating copy to clipboard operation
babel-plugin-dynamic-import-webpack copied to clipboard

[breaking][do-not-merge] CJS interop changes

Open bmeck opened this issue 8 years ago • 4 comments

Relates to https://github.com/airbnb/babel-plugin-dynamic-import-webpack/issues/12

Has breaking change, unclear on intent here so marked as do not merge until discussion.

bmeck avatar Dec 07 '16 15:12 bmeck

@ljharb fixed up, can move the proto to be the module.exports value if desired, but using named property access is still up in the air, using .default is the future safe option.

bmeck avatar Dec 07 '16 18:12 bmeck

@ljharb with potential change to _interopRequireWildcard, going to change recommendation to just use _interopRequireWildcard rather than a custom interop boilerplate

bmeck avatar Dec 08 '16 15:12 bmeck

@bmeck Can you clarify what you mean by "potential change to _interopRequireWildcard"? As of today the helper hasn't changed in > 2 years.

Do we know yet whether import() will allow access to named exports?

gdborton avatar May 04 '17 22:05 gdborton

@gdborton we do know that; import() will provide a ModuleRecord, which will provide (i believe) a .default, and definitely .foo for all named exports.

ljharb avatar May 04 '17 22:05 ljharb