-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add Rollup plugin with support for Node built-in modules #288
Comments
Good catch, can you make a PR? |
I think we can skip the plugin & do a special case for require('module').builtinModules || Object.keys(process.binding('natives')) |
@lukeed Spot on. But wouldn't that resolution logic belong in Rollup? |
@gaui Personally, I would vote yes, but realistically it's not something Rollup can/wants to do because you may have shims/custom modules that share the same names, and the above would likely (have to) override anything non-native with the native version. |
If you're naming your modules the same as the natives, you're doing something wrong. 😄 |
@Rich-Harris what do you think? |
@lukeed Is it possible to mark those modules returned from the above function, as external so Rollup knows? Not familiar with microbundle internals. |
When importing
child_process
and targeting node, I still get this error from #238 :This can be bypassed by adding
--external child_process
argument. Still I get this message:So please add package
rollup-plugin-node-builtins
so Rollup knows how to detect Node built-in modules and resolve them appropriately.The text was updated successfully, but these errors were encountered: