-
Notifications
You must be signed in to change notification settings - Fork 472
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
fix: require.cache undefined #2468
fix: require.cache undefined #2468
Conversation
🦋 Changeset detectedLatest commit: 63adda6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@faga295 Could you refactor the code using const dependency? here is an example https://github.com/web-infra-dev/rspack/blob/main/crates/rspack_plugin_javascript/src/visitors/dependency/scanner.rs#L336 |
Ok, I have refactored it, please review it. |
crates/rspack_plugin_javascript/src/visitors/dependency/scanner.rs
Outdated
Show resolved
Hide resolved
@faga295 The cla is not signed. Look like your name of commit is not equal to your github name, Could you check it? |
thank you for your remind, it works now. |
@faga295 Look like you need to rebase the main branch, because |
@faga295 I fixed clippy error at my commit. It colud run ci success. |
Thanks a lot! |
Summary
closed #2460
Currently,
require.cache
will transform to__webpack_require__.c
, but I'm confusing about where to insertruntime_globals::MODULE_CACHE
toruntime_requirement
.Since
&mut runtime_requirement
is borrowed toinject_runtime_helper
, I can't find a good solution unless move transformrequire.cache
operation toinject_runtime_helper
and insertMODULE_CACHE
in it.Perhaps my confusion comes from my lack of familiarity with rust, and if so, please forgive me, I'm trying to learn.
Related issue (if exists)
Types of changes
Checklist
pnpm run changeset
.