Commit f7b83e5a21c for woocommerce
commit f7b83e5a21ce8a816985a9ae457c91205eaf177a
Author: ahmedevsaad <105542236+ahmedevsaad@users.noreply.github.com>
Date: Wed Sep 30 12:12:04 2026 +0300
Resolve blocks webpack entry paths with POSIX separators (#68607)
glob.sync with dotRelative returns platform-native paths, so on Windows the
styling entries came out as ".\packages\public-api\..." and webpack failed
with "Can't resolve", stopping the blocks build. posix: true keeps the
forward slashes webpack needs and is a no-op on POSIX platforms.
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
diff --git a/plugins/woocommerce/changelog/fix-blocks-windows-glob-entry-paths b/plugins/woocommerce/changelog/fix-blocks-windows-glob-entry-paths
new file mode 100644
index 00000000000..8623e2bab53
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-blocks-windows-glob-entry-paths
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Resolve blocks webpack entry paths with POSIX separators so the build works on Windows.
diff --git a/plugins/woocommerce/client/blocks/bin/webpack-entries.js b/plugins/woocommerce/client/blocks/bin/webpack-entries.js
index 0318fa6fc6b..5868bcfa87c 100644
--- a/plugins/woocommerce/client/blocks/bin/webpack-entries.js
+++ b/plugins/woocommerce/client/blocks/bin/webpack-entries.js
@@ -276,7 +276,7 @@ const getBlockEntries = ( relativePath, blockEntries = blocks ) => {
const filePaths = glob.sync(
`./assets/js/blocks/${ config.customDir || blockCode }/` +
relativePath,
- { dotRelative: true }
+ { dotRelative: true, posix: true }
);
if ( filePaths.length > 0 ) {
return [ blockCode, filePaths ];
@@ -343,6 +343,7 @@ const entries = {
'./packages/public-api/{price-format,blocks-components,blocks-checkout}/**/index.{t,j}s',
{
dotRelative: true,
+ posix: true,
}
),