Suppose I\'m creating an ES6 library with multiple files, but have a root file that contains all of the top-level definitions. How could I achieve something like this exampl
You have to re-export:
lib/main.js import { Sub } from './foo/sub'; export { Sub };
You can re-export directly like this:
export { Sub } from './foo/sub';
You can rename when exporting:
export { Sub as MySub } from './foo/sub';
Or re-export everything:
export * from './foo/sub';