You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which is the behavior you get with import x from './x'.
Additionally, I'm using this in conjunction with esbuild-plugin-yaml, which generates even more overhead because every "export" essentially gets repeated. While this is not a common case, it does illustrate the problem rather well.
You could argue that esbuild should figure this out, but I think the plugin can also do a better job at understanding exports, be it with some help from the programmer.
One option would be to embed some config in the import glob:
or the config could be prefixed instead of suffixed. Alternatively, this could be a good case for (nonstandard) import assertions, but I imagine that would take more parsing.
Just spitballing though. WDYT?
The text was updated successfully, but these errors were encountered:
Right now, imports are hardcoded as
import * from './x'
, which generates a lot of boilerplate if there's only one export.Particularly if you only have a default export, you get something like:
while it could just be:
which is the behavior you get with
import x from './x'
.Additionally, I'm using this in conjunction with esbuild-plugin-yaml, which generates even more overhead because every "export" essentially gets repeated. While this is not a common case, it does illustrate the problem rather well.
You could argue that esbuild should figure this out, but I think the plugin can also do a better job at understanding exports, be it with some help from the programmer.
One option would be to embed some config in the import glob:
or the config could be prefixed instead of suffixed. Alternatively, this could be a good case for (nonstandard) import assertions, but I imagine that would take more parsing.
Just spitballing though. WDYT?
The text was updated successfully, but these errors were encountered: