indexr
indexr copied to clipboard
Export named object
Hi,
Nice project!
I have however a question; I usually name my export like following:
// test.js
export function foo() {
return 'foo';
}
export function foo() {
return 'bar';
}
But when I use indexr, it will create the following content (indexr -m "." --submodules "test.js" . --named-exports):
export { default as testJs } from './test.js';
Which will not work :/
If indexr, however, created the following file:
export * from './test.js';
everything would work perfectly. Is it possible to add an extra flag to just export everything (star export as shown above)?
hmm this is a reasonable request and is easy to do however this kind of thing opens up a floodgate of other possibilities (ie. take the exports called 'foo' and put them in an index called 'foo.js') which might be better configured more flexibly using comment annotations or global config which would deprecate all flags (probably a good thing). I need to think about how best to do this.