Skip to content

Commit

Permalink
webpack-config: Set output.uniqueName (#41315)
Browse files Browse the repository at this point in the history
* webpack-config: Set `output.uniqueName`

When we removed a bunch of otherwise-useless "name" properties from
`package.json` files, it turns out that caused Webpack to start using
the empty string for its `output.uniqueName`, which may result in
collisions if multiple bundles on a page do the same thing.

To avoid this, read the "name" from composer.json if package.json lacks
one.

Also, since we're now setting `output.uniqueName`, various webpack
configs using `output.library.name` should also set `output.uniqueName`
to maintain the previous behavior.

* Remove for entry.x.library.name

Hopefully Webpack does the right thing on its own for those.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12957398511

Upstream-Ref: Automattic/jetpack@18b4f12
  • Loading branch information
tbradsha authored and matticbot committed Jan 24, 2025
1 parent 561670c commit fdc7775
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 83 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fdc7775

Please sign in to comment.