test: Add tests for web and webworker target compatibility and auto public path handling#20554
Conversation
|
Merging this PR will degrade performance by 37.56%
Performance Changes
Comparing |
|
@alexander-akait all checked passed CI is green now, thanks ! |
|
This PR is packaged and the instant preview is available (4098902). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@4098902
yarn add -D webpack@https://pkg.pr.new/webpack@4098902
pnpm add -D webpack@https://pkg.pr.new/webpack@4098902 |
Summary
This PR adds two new test cases to verify webpack’s behavior when the target is set to both "web" and "webworker". The first test checks that webpack correctly bundles code so it runs seamlessly in both browser and web worker environments. The second test ensures that when code is running inside a web worker, webpack automatically sets the public path for loading additional chunks, so dynamic imports and code splitting work without manual configuration. These tests help guarantee that webpack’s output is reliable and compatible for advanced use cases involving web workers.
What kind of change does this PR introduce?
test
Did you add tests for your changes?
Yes, this PR only adds new tests.
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
No documentation changes needed; this PR only adds tests.
Use of AI
No AI was used in writing these tests or this PR.