-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
[Feature Request]: non_webpack_require #2408
Comments
we should support it but you can workaround it by |
Just to note for users reading, libraries may have issues till this is patched if they depend on breaking out of webpack with non require. |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
where do you use the __non_webpack_require api? can yo paste the coe |
the package // node_modules/app-root-path/lib/resolve.js
//...
// If we're in webpack, force it to use the original require() method
var requireFunction = ("function" === typeof __webpack_require__ || "function" === typeof __non_webpack_require__)
? __non_webpack_require__
: require;
// ... |
so you use some third-party module which use |
yes |
you either wait for rspack no_webpack_require implementation or use patch-package to modify third party mode code |
when i use non_webpack_require, an error occurs : |
What problem does this feature solve?
This allows me to skip bundling a specific require call.
__non_webpack_require__
is converted back intorequire
and is often used inside libraries as a way to escape the containers closure.This is the same concept as webpack magic comments for webpackIgnore on a import(), which tells webpack to use native import() spec to load that specific file. For require or sync imports - non_webpack_require does the same kind of thing
What does the proposed API of configuration look like?
this is syntax sugar, no outward facing api.
I believe this would be a parser update or require factory alteration to match how webpack does it currently.
The text was updated successfully, but these errors were encountered: