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
It's great that this plugin exposes both the modules and their filenames. However, it's somewhat tedious that it does so by exposing a named export alongside a default one. Additionally, I think one should have to zip the two arrays to match a module to its filename.
Personally, I would export an array of module records: { filename: string, module: any }[]. To help folks who aren't interested in the filenames, you could optionally also export the modules, and the same logic could be applied to the filenames.
Because this would create multiple exports, and also because a lot of people feel that default exports shouldn't be part of JS, all three exports should be named. I.e., you could import { records } (I can't think of a better name right now), but also { modules, filenames } to get the current behavior.
Sidenote: I've noticed that bundlers typically refer to the filenames with id, because they're internally treated as module identifiers. Thus, this could be an opportunity to move away from "filename" too.
The text was updated successfully, but these errors were encountered:
It's great that this plugin exposes both the modules and their filenames. However, it's somewhat tedious that it does so by exposing a named export alongside a default one. Additionally, I think one should have to zip the two arrays to match a module to its filename.
Personally, I would export an array of module records:
{ filename: string, module: any }[]
. To help folks who aren't interested in the filenames, you could optionally also export the modules, and the same logic could be applied to the filenames.Because this would create multiple exports, and also because a lot of people feel that default exports shouldn't be part of JS, all three exports should be named. I.e., you could
import { records }
(I can't think of a better name right now), but also{ modules, filenames }
to get the current behavior.Sidenote: I've noticed that bundlers typically refer to the filenames with
id
, because they're internally treated as module identifiers. Thus, this could be an opportunity to move away from "filename" too.The text was updated successfully, but these errors were encountered: