-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subpath imports don't work for built-in Node modules #310
Comments
As a hack for now I could suggest to put
|
The workaround by @vankop sounds good. This is a little bit complicated to fix... |
Does it? For non-subpath imports, Webpack already knows to avoid trying to bundle |
@nex3 I have created small example, take a look https://github.com/vankop/bundle-fs |
Let's close in favor of #303 |
I don't think #303 addresses this—the core issue here is that this behavior is specified to work in Node.js, but Webpack is incompatible with it. In other words, this is a bug report, not a feature request that could be addressed by supporting the feature in some other way. |
It is the same, we don't support resolution built-in Node.js modules neither in |
Support for subpath imports was added in #293, but they're broken if one of the subpaths is a built-in Node.js module. To reproduce:
package.json
:lib/main.js
:Run
npx webpack build --target node --entry ./lib/main.js
. It produces this error:The text was updated successfully, but these errors were encountered: