React I develop the application and Refluxwhich is associated with webpacka babel-loader(v6), and I have problems with addictions e6 modules
For example, I have a component that uses reflux .connect()mixin:
import MyStore from '../stores/my-store';
const Component = React.createClass({
mixins: [Reflux.connect(MyStore)]
});
When I import all the modules separately in each file like this, everything is fine.
Then I tried to improve my code using deconstructed import statements:
... in the component:
//import One from '../js/one';
//import Two from '../js/two';
//import Three from '../js/three';
import { One, Two, Three } from '../js'; // Instead
... and in js/index.js:
import One from './one';
import Two from './two';
import Three from './three';
export { One, Two, Three };
The application source files are more concise using the technique described above, because I can import all the components in one line import.
But when I use it, some dependencies end up beeing undefinedwhen I use them
If I use the same updated example ...
import { MyStore } from '../stores';
const Component = React.createClass({
mixins: [Reflux.connect(MyStore)]
});
Parameter... MyStoreends undefinedin the method Reflux.connect.
I tried to fix the problem in the debugger, but I do not know what happens to the statements __webpack_require__(xxx)in the generated package. There should be a circular dependency that babel-loaderor the required web package could not determine when there are files index.jsthat re-export the individual modules.
Do you know any tool that will help me figure this out? I tried madge, but it does not work with es6 modules, and I could not find anything that could tell me where something was wrong.