I'm getting a bit lost in TS re-exports. Say I create a pair of test modules;
test1.ts;
export function test1() {
return 'test';
}
test2.ts;
export function test2() {
return 'test';
}
I believe I should be able to then do something like this;
combined.ts;
export * from './test1';
export * from './test2';
module.exports = {
test1: test1,
test2: test2
};
But, no such luck. There seem to be lots of GitHub issues discussing various approaches to this, including an old hack using export import * from './test1'
but they all seem to argue what the ES6 spec really means, and none actually work..
What's the right way to do a rollup like this? Am I just going down the wrong path to split a module up across files? Are namespaces more appropriate here?