-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
require.cache missing #1959
Comments
It has no properties, it's just a function that takes in the location of a file. Or identifier in compiled code. If you really wanna dig into parcel internals there is a resolve property on it but that's it. You can have a look at https://github.com/parcel-bundler/parcel/blob/master/src/builtins/prelude.js for the entire implementation of require |
Hmm, is there a reason that stubs for require.cache and the like couldn't be added to local require to better support bundled node modules? They wouldn't do anything, but I think it would still help compatibility |
What's the use-case? |
Preventing code like this from crashing on startup |
Feel free to open up a PR or RFC |
* Added a simple stub for require.cache in prelude (#1959)
* Added a simple stub for require.cache in prelude (#1959)
* Added a simple stub for require.cache in prelude (#1959)
β Question
What properties are supposed to be available on the require object at runtime? Is it intended to fully mirror the node require?
π¦ Context
I am testing out the new "--bundle-node-modules" option, but some node_modules try to get the keys for the require cache and die.
π» Code Sample
This code will fail when bundled
π Your Environment
The text was updated successfully, but these errors were encountered: