I am trying to export a es6 module in header.js
:
export default {
setHeaderHighlight: function (index) {
// do somethings
}
};
And import it in index.js
:
import header from "./header.js"
$(function () {
header.setHeaderHighlight(0);
});
Then transformation comes out in index.bundle.js
:
var _header = __webpack_require__(129);
var _header2 = _interopRequireDefault(_header);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj }; // crash here
}
So here is the problem, ie8 will rise a Expected identifier
Exception at { default: obj }
, but everythings is ok >=ie9.
Is there something i can do with this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…