ElementUI / babel-plugin-component

Modular element-ui build plugin for babel.
452 stars 96 forks source link

Fix/babel 7.0.0 #50

Closed aphofstede closed 9 months ago

aphofstede commented 5 years ago

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 commented 5 years ago

@QingWei-Li ?

aphofstede commented 5 years ago

@Leopoldthecoder?