Skip to content

test: Add tests for web and webworker target compatibility and auto public path handling#20554

Merged
alexander-akait merged 1 commit intowebpack:mainfrom
aryanraj45:test/web-webworker-configcases
Feb 28, 2026
Merged

test: Add tests for web and webworker target compatibility and auto public path handling#20554
alexander-akait merged 1 commit intowebpack:mainfrom
aryanraj45:test/web-webworker-configcases

Conversation

@aryanraj45
Copy link
Contributor

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.

@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2026

⚠️ No Changeset found

Latest commit: 06b4856

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 28, 2026

Merging this PR will degrade performance by 37.56%

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 141 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory benchmark "future-defaults", scenario '{"name":"mode-production","mode":"production"}' 10 MB 8 MB +24.98%
Memory benchmark "json-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 619.7 KB 992.5 KB -37.56%
Memory benchmark "react", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 864.3 KB 643.7 KB +34.27%

Comparing aryanraj45:test/web-webworker-configcases (06b4856) with main (2019127)

Open in CodSpeed

@aryanraj45
Copy link
Contributor Author

@alexander-akait all checked passed CI is green now, thanks !

@alexander-akait alexander-akait merged commit 4098902 into webpack:main Feb 28, 2026
95 of 97 checks passed
@github-actions
Copy link
Contributor

This PR is packaged and the instant preview is available (4098902).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@4098902
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@4098902
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@4098902

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.

2 participants