javascript - ES6 global import -


what best way import modules in of files of project, don't have write stuff like:

import react 'react'; import reflux 'reflux'; import reactmixin 'react-mixin'; 

in every single file?

the other answer covers this, not valid es6, i'm adding own. make central file import react components, in central react.js file

export {default react} 'react'; export {default reflux} 'reflux'; export {default reactmixin} 'react-mixin'; 

then in files need use these three, do

import {react, reflux, reactmixin} './react'; 

to import 3 component file.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -