export * form 'some-library'
export * from './myOverrides'
// error: [ts] Module 'some-module' has already
// exported a member named 'someFunc'.
// Consider explicitly re-exporting to resolve the ambiguity.
import * as SomeLib from 'some-library'
import * as MyOverrides from './myOverrides'
export { ...SomeLib, ...MyOverrides } // syntax error
const Overridden = { ...someLib, ...MyOverrides } // works
export { ...Overridden } // syntax error
我想避免挑选出所有命名的出口只是为了再出口他们;
import { a, b, c, d, e, ..... } from 'some-library'
export { a, b, c, d, e, .... }
export * from './myOverrides'
3条答案
按热度按时间wmomyfyw1#
Guy Sensei:
https://github.com/systemjs/systemjs/issues/1031#issuecomment-171262430
我需要:
这是因为本地出口优先。
ozxc1zmp2#
我发现这个工作得很好:
whlutmcx3#
如果您想导出整个模块:
然后你可以在另一个文件中使用它: