Ensure that the wildcard interop is used with re-export + default. (#8316)

This commit is contained in:
Logan Smyth
2018-07-14 12:49:31 -07:00
committed by GitHub
parent 62ee1adc85
commit 935533cff3
3 changed files with 41 additions and 4 deletions

View File

@@ -0,0 +1,6 @@
// The fact that this exports both a normal default, and all of the names via
// re-export is an edge case that is important not to miss. See
// https://github.com/babel/babel/issues/8306 as an example.
import _default from 'react';
export default _default;
export * from 'react';

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {};
exports.default = void 0;
var _react = babelHelpers.interopRequireWildcard(require("react"));
Object.keys(_react).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _react[key];
}
});
});
// The fact that this exports both a normal default, and all of the names via
// re-export is an edge case that is important not to miss. See
// https://github.com/babel/babel/issues/8306 as an example.
var _default2 = _react.default;
exports.default = _default2;