Skip to content

fix:that the external modules load without reload when lazy-compilation #19477

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Vansh5632
Copy link
Contributor

fixes: #19134

Fixed issue with external dependencies not loading properly on first visit when lazy compilation is enabled

Added logic to ensure external dependencies are properly initialized before lazy-loaded chunks that depend on them

Enhanced the LazyCompilationProxyModule to detect and handle external dependencies

Added new runtime helper to ensure external dependencies are loaded in the correct order

hooks = {
createScript: new SyncWaterfallHook(["source", "chunk"])
createScript: new SyncWaterfallHook(["code", "chunk"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid unnecessary changes which is not related to fixes

}
return false;
})
: false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad idea, we should register runtime inside ExternalModule

makeSerializable(
ExternalModuleInitFragment,
"webpack/lib/dependencies/ExternalModuleInitFragment"
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it was removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After turning on lazyCompilation, the first load of externals will fail
2 participants