How do I export as default multiple imported modules?
I could do something like the code below, but if I were to import multiple files the boilerplate could grow quickly. Is there a shorthand way to achieve this?
import Foo from './Foo'
import Bar from './Bar'
//...
export default {
Foo,
Bar
//...
}
Note that in my code above, I'm not exporting multiple values. I'm importing multiple values, accumulating them, and exporting them as a single object. I intend to refer to the reexported values by Baz.Foo
or Baz.Bar
, assuming the code above is Baz.js
.