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 da48ff4 commit 707e6f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@automattic/jetpack-analytics": "^0.1.35",
"@automattic/jetpack-api": "^0.17.22",
"@automattic/jetpack-base-styles": "^0.6.41",
"@automattic/jetpack-boost-score-api": "^0.1.52",
"@automattic/jetpack-boost-score-api": "^0.1.53-alpha",
"@automattic/jetpack-components": "^0.65.4",
"@automattic/jetpack-connection": "^0.36.4",
"@automattic/jetpack-explat": "^0.2.4",
Expand Down

0 comments on commit 707e6f6

Please sign in to comment.