Commit 5f6c4153e6d for woocommerce
commit 5f6c4153e6d112fcc36055701384aec1af204782
Author: Jarda Snajdr <jsnajdr@gmail.com>
Date: Thu Aug 13 11:57:51 2026 +0200
Give nice names to dynamic chunks and stylesheets (#49368)
* Give nice names to dynamic chunks and stylesheets
* changelogs
* remove changelog
---------
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
diff --git a/packages/js/internal-build/src/style-build/index.cjs b/packages/js/internal-build/src/style-build/index.cjs
index aa2ded78499..e44643a20e8 100644
--- a/packages/js/internal-build/src/style-build/index.cjs
+++ b/packages/js/internal-build/src/style-build/index.cjs
@@ -78,7 +78,7 @@ module.exports = {
new RemoveEmptyScriptsPlugin(),
new MiniCssExtractPlugin( {
filename: '[name]/style.css',
- chunkFilename: 'chunks/[id].style.css?ver=[contenthash]',
+ chunkFilename: 'chunks/[name].style.css?ver=[contenthash]',
} ),
new WebpackRTLPlugin(),
new StyleAssetPlugin(),
diff --git a/plugins/woocommerce/changelog/49368-add-webpack-chunk-names b/plugins/woocommerce/changelog/49368-add-webpack-chunk-names
new file mode 100644
index 00000000000..165e9d62221
--- /dev/null
+++ b/plugins/woocommerce/changelog/49368-add-webpack-chunk-names
@@ -0,0 +1,4 @@
+Significance: patch
+Type: tweak
+
+Give nice names to webpack JS and CSS dynamic chunks
\ No newline at end of file
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts b/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts
index e672d461a75..2abbe0c6d35 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts
@@ -13,12 +13,16 @@ import './launch-your-store';
const possiblyImportProductTask = async () => {
if ( isImportProduct() ) {
- void import( './import-products' );
+ void import(
+ /* webpackChunkName: "import-products" */ './import-products'
+ );
} else {
- void import( './products' );
+ void import( /* webpackChunkName: "products" */ './products' );
}
};
void possiblyImportProductTask();
-void import( './shipping-recommendation' );
+void import(
+ /* webpackChunkName: "shipping-recommendation" */ './shipping-recommendation'
+);
diff --git a/plugins/woocommerce/client/admin/client/xstate.js b/plugins/woocommerce/client/admin/client/xstate.js
index ce3d1b2b2d3..507f1fa04df 100644
--- a/plugins/woocommerce/client/admin/client/xstate.js
+++ b/plugins/woocommerce/client/admin/client/xstate.js
@@ -27,7 +27,9 @@ async function enableXStateV4Inspect() {
*/
let XStateV5Inspect;
async function enableXStateV5Inspect() {
- const { createBrowserInspector } = await import( '@statelyai/inspect' );
+ const { createBrowserInspector } = await import(
+ /* webpackChunkName: "statelyai-inspect" */ '@statelyai/inspect'
+ );
XStateV5Inspect = createBrowserInspector;
// eslint-disable-next-line no-console
console.log(