Hacker News new | ask | show | jobs
by Ginden 1691 days ago
> - "export already_imported_variable;" - why the HECK is this not in the specification? Having to declare new variable names for exports makes the creation of "index" files so damn painful. This syntax could fix this.

You can do:

   export {already_imported_variable}
1 comments

...which is a default export, not a named export, as I already explained. My point was about the lack of exporting named exports without the need to declare variable names.

Your solution will work only once in a file, therefore it is useless to batch-export lots of imports for the mentioned use case of an "index" file that exports all your classes and definitions.

It isn't default export, as you can see here: https://babeljs.io/repl#?browsers=node16&build=&builtIns=fal...