有没有使用ES6、ES7或babel的语法可以让我轻松地捆绑许多子文件组?
例如,给定:
./action_creators/index.js
./action_creators/foo_actions.js
./action_creators/bar_actions.js
将foo和bar actions导入到index.js中,然后重新导出它们,这样我就可以
import {FooAction, BarAction} from './action_creators/index.js'
如果我要更改对象本身所组织的文件,我不想记住/更改引用。
export { default as foo } from './foo';
来重新导出另一个模块的默认导出。 - clodalexport * as something from './something'
。有什么想法吗? - Qwertyimport * as Something from './something'; export { Something }
- Jasmine Hegmanexport * from ...
行导出了同名的命名函数会发生什么?我的意思是,如果export * from 'a';
和export * from 'b';
都定义了一个同名的函数并导出它,例如:export function fn() { ... }
… - tonixexport * as something from ...
这个语法... 哈哈哈。 - Qwerty