-
-
Notifications
You must be signed in to change notification settings - Fork 233
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: avoid shared module will be compiled in wrong target compiler #1996
Conversation
@ScriptedAlchemy I'm not sure whether the ProvideSharedPlugin can use thisCompilation instead of compilation, please help to review and check |
the webpack reproduce demo:
One is bundled from htmlPlugin childCompiler and the other is from main compiler |
I'm not sure of the implications of doing this. Would it mean that any child compilers created would not include any federation stuff unless the plugin is applied again on the child compiler? |
Can we cut a release of this? then i can override the packages in federation examples and we can test against all those as well |
@ScriptedAlchemy Yes, because the child compiler may have different target than the main compiler. Like HtmlPlugin sub cpmpiler will have node target, but the main compiler have browser target . But maybe we can solve it according another way . |
@ScriptedAlchemy Can you help to check this demo ? Maybe we can solve the issue in a simple way. |
This is caused by Actually the additional html-webpack-plugin asset won't affect anything, and won't cause any issue, only the output size is bigger, I think it's ok to have these additional html-webpack-plugin assets. |
Change htmlWebpackPlugin from child compiler to |
@ahabhgk Yes, it will not have issues in most cases . But if users set chunkFileName as |
@ahabhgk how to set |
HtmlWebpackPlugin use child compiler to compile and execute to get the html asset, importModule (executeModule) is an alternative for child compiler, MiniCssExtractPlugin already switch to importModule from child compiler, HtmlWebpackPlugin hasn't, maybe we can have a try and contribute to HtmlWebpackPlugin |
One thing that wired to me is ConsumeSharedPlugin is using |
Stale pull request message |
Stale pull request message |
Description
html-webpack-plugin
will use childCompiler which loader target is node to compile . And it will output the asset if the shared set a file path like this:html-webpack-plugin asset:
default target(browser) asset:
Related Issue
Types of changes
Checklist