Skip to content

Commit 78e9db2

Browse files
committed
Normalize paths betweens Operating systems
1 parent 429fbc9 commit 78e9db2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/gutenberg/copy-gutenberg-build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ function generateScriptModulesPackages() {
240240
processDirectory( fullPath, baseDir );
241241
} else if ( entry.name.endsWith( '.min.asset.php' ) ) {
242242
const relativePath = path.relative( baseDir, fullPath );
243-
const jsPathMin = relativePath.replace( /\.asset\.php$/, '.js' );
243+
// Normalize path separators to forward slashes for cross-platform consistency
244+
const normalizedPath = relativePath.split( path.sep ).join( '/' );
245+
const jsPathMin = normalizedPath.replace( /\.asset\.php$/, '.js' );
244246
const jsPathRegular = jsPathMin.replace( /\.min\.js$/, '.js' );
245247

246248
try {

0 commit comments

Comments
 (0)