In order to keep track of the file name that the module imports from, I have added a xxxByPath variable that contains a map from the filename to the corresponding module.
This is "non-breaking" in that this variable is unlikely to be used by anyone.
A better solution (which is quite breaking and not implemented here) would be to only output the new variable, since it can be used to generate the current array via Object.values(moduleObject). That way only the variable name the user specified would be used.
In order to keep track of the file name that the module imports from, I have added a
xxxByPath
variable that contains a map from the filename to the corresponding module.This is "non-breaking" in that this variable is unlikely to be used by anyone.
A better solution (which is quite breaking and not implemented here) would be to only output the new variable, since it can be used to generate the current array via
Object.values(moduleObject)
. That way only the variable name the user specified would be used.