有没有类似的东西:
export * as * from 'myJavaScriptFile.js'
我似乎想要
"A way to export all variables which are exported from a file to be re-exported from another file - not with a new reference but whatever reference it was exported in the first place"
不像下面这样:因为有一个新的引用(allStuff)
import default, * as allStuff from 'myJavaScriptFile.js';
export { allStuff };
最佳答案
您正在寻找这个:
export * from './typescript-file';
export * from './javascript-file';
这将重新导出从该文件导出的所有内容
这通常用于桶文件 (index.ts
)
关于javascript - 使用 ES6Modules 将 * 导出为 *,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59966526/