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
{{ message }}
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
If I had to guess at a proper fix, it would be this: when calling resolve, we should first check if the module is a core module1, and if so, and preferBuiltins is false, then a trailing slash should be appended to the module name passed to resolve. If this fails to resolve anything, resolved reverts back to importee.
[1]: I also observe that resolve maintains a list of node builtins, so some duplication could also probably be removed as part of this effort.
The text was updated successfully, but these errors were encountered:
How Do We Reproduce?
First install the buffer shim, named "buffer":
Configure this plugin with preferBuiltins: false:
And attempt to create a browser bundle of the following application:
Expected Behavior
Buffer is bundled.
Actual Behavior
Buffer is not bundled, and warnings are emitted about depending on a built-in module.
I believe this is due to a recent-ish change in resolve in how it handles shadowed modules. Versions of resolve prior to 1.11.1 (including 1.11.0) will happily resolve a module named
buffer
, but 1.11.1 will simply returnbuffer
back.If I had to guess at a proper fix, it would be this: when calling resolve, we should first check if the module is a core module1, and if so, and preferBuiltins is false, then a trailing slash should be appended to the module name passed to resolve. If this fails to resolve anything, resolved reverts back to importee.
[1]: I also observe that resolve maintains a list of node builtins, so some duplication could also probably be removed as part of this effort.
The text was updated successfully, but these errors were encountered: