Sto cercando di esportare un modulo ES6 in header.js
:Babel 6.0.20 I moduli non geometria di lavoro in IE8
export default {
setHeaderHighlight: function (index) {
// do somethings
}
};
e importarlo in index.js
:
import header from "./header.js"
$(function() {
header.setHeaderHighlight(0);
});
Poi trasformazione viene fuori 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
}
Quindi ecco il problema, ie8 salirà un Expected identifier
Eccezione allo { default: obj }
, ma tutto è ok> = ie9.
C'è qualcosa che posso fare con questo?
Ho trovato una soluzione temporanea: 'webpack -p' farà la stessa cosa dei due plugin babel es3. – Bruce