babel-plugin-component icon indicating copy to clipboard operation
babel-plugin-component copied to clipboard

Fix/babel 7.0.0

Open aphofstede opened this issue 5 years ago • 2 comments

Set babel dependencies to ^7.0.0. (Fixes #48) Produces a couple of issues that need project maintainer feedback.

Going through the new output files, this one looks suspicious to me (unexpected _Select var):

// test/fixtures/conditions/expected.js
"use strict";

require("element-ui/lib/select/style.css");

var _select = _interopRequireDefault(require("element-ui/lib/select"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

if (a === _select["default"]) { }

if (_Select) { }

_Select ? 'a' : 'b';
a ? _Select : 2;
_Select || 'a';
a || _Select;

Another mystery guest: (_Element)

// test/fixtures/import-all-css/expected.js
"use strict";

require("element-ui/lib/style.css");

var _lib = _interopRequireDefault(require("element-ui/lib"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

console.log(_lib["default"].Button);
console.log(_Element);

And one more: (same as above)

// test/fixtures/import-module/expected.js
"use strict";

require("element-ui/lib/abc/style.css");

var _abc = _interopRequireDefault(require("element-ui/lib/abc"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

console.log(_abc["default"].Button);
console.log(_Element);

I would expect something like var _Element = bind({})(_abc["default"]); or just console.log(_abc["default"]);?

aphofstede avatar Apr 14 '19 12:04 aphofstede

@QingWei-Li ?

aphofstede avatar Apr 14 '19 12:04 aphofstede

@Leopoldthecoder?

aphofstede avatar Apr 24 '19 21:04 aphofstede