tj / consolidate.js

Template engine consolidation library for node.js
3.48k stars 357 forks source link

Issue with babel modules #303

Closed felixcatto closed 6 years ago

felixcatto commented 6 years ago

Hi, i use babel for transform react code, so after transformations code looks like this https://i.imgur.com/5djHZDr.png

But when i execute this code https://i.imgur.com/6Zg2VW9.png

i got a error https://i.imgur.com/cdIxNGs.png

But if i add "module.exports = Alert;", there is no error and all going good. https://i.imgur.com/86wzyJE.png

I suppose that something wrong with this library. This is example of code from screen

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = Alert;

var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function Alert() {
  return _react2.default.createElement(
    'div',
    null,
    'some text'
  );
}