convert es6 imports without brackets

This commit is contained in:
Liad Yosef 2015-05-10 17:23:25 +03:00
parent 8ca28b2f70
commit e8d95c1a47
3 changed files with 7 additions and 7 deletions

View File

@ -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)));
}

View File

@ -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');
}

View File

@ -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', {});
};