对于file1
,我有
import * as Things1 from "../things1"
import * as Things2 from "../things2"
export {
Things1,
Things2,
}
对于file2
,我有
import * as Distributor from "../file1"
import * as Things3 from "../../things3"
如何导出它使它看起来像
export {
Things1,
Things2,
Things3,
}
infile2
?
我不想用
export const Things1 = Distributor.Things1;
因为在我的实际文件
中导出了很多变量您可以像这样直接导出所有内容:
export * from "../file1"; // export everything from file1
export { Things3 } from "../../thing3"; // selectively export only Things3