diff --git a/README.md b/README.md index 08a2757..f553c9e 100644 --- a/README.md +++ b/README.md @@ -349,10 +349,10 @@ module.exports = function () { ``` ###### Compiled (with ES6 flag): ```javascript -import { React } from 'react/addons'; -import { _ } from 'lodash'; -import { MyComp } from 'comps/myComp'; -import { utils } from 'utils/utils'; +import React from 'react/addons'; +import _ from 'lodash'; +import MyComp from 'comps/myComp'; +import utils from 'utils/utils'; function repeatItem1(item, itemIndex) { return React.createElement(MyComp, {}, React.createElement('div', {}, utils.toLower(item.name))); } diff --git a/src/reactTemplates.js b/src/reactTemplates.js index c9f691a..47557d7 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -475,7 +475,7 @@ function convertRT(html, reportContext, options) { if (options.modules === 'typescript') { vars = _(defines).map(function (reqVar, reqPath) { return 'import ' + reqVar + " = require('" + reqPath + "');"; }).join('\n'); } else if (options.modules === 'es6') { - vars = _(defines).map(function (reqVar, reqPath) { return 'import {' + reqVar + "} from '" + reqPath + "';"; }).join('\n'); + vars = _(defines).map(function (reqVar, reqPath) { return 'import ' + reqVar + " from '" + reqPath + "';"; }).join('\n'); } else { vars = _(defines).map(function (reqVar, reqPath) { return 'var ' + reqVar + " = require('" + reqPath + "');"; }).join('\n'); } diff --git a/test/data/div.rt.es6.js b/test/data/div.rt.es6.js index 7070bfb..4f40316 100644 --- a/test/data/div.rt.es6.js +++ b/test/data/div.rt.es6.js @@ -1,5 +1,5 @@ -import { React } from 'react/addons'; -import { _ } from 'lodash'; +import React from 'react/addons'; +import _ from 'lodash'; export default function () { return React.createElement('div', {}); }; \ No newline at end of file