1

I am new in modern JS world and some things confusing me a little.

In my project I use the following tools:

  • webpack for build configuration and execution;
  • babel as I understand used to compile JSX sources into JS;

Suppose I have following jsx modules:

foo.jsx

export default function foo(){}

bar1.jsx

import {foo} from './foo';

bar2.jsx

import foo from './foo';

So what is the difference between foo in bar1.jsx and bar2.jsx?

Sergey Bespalov
  • 1,746
  • 1
  • 12
  • 29
  • Another dupe: http://stackoverflow.com/q/31096597/251311 – zerkms Oct 26 '16 at 06:41
  • Not sure it is duplicate. May be wording of the question is not entirely clear. `webpack` produce different result code: `var _foo = __webpack_require__(279); var _foo2 = _interopRequireDefault(_foo);` and `var _foo = __webpack_require__(279);` – Sergey Bespalov Oct 26 '16 at 06:55
  • Webpack surely produces different output because those 2 imports are different. Differences are explained in either of the 2 duplicates. – zerkms Oct 26 '16 at 06:56
  • 1
    Got it, thanks. Simple things in new areas are sometimes introduced into confusion :) – Sergey Bespalov Oct 26 '16 at 07:02

0 Answers0