Skip to content

Commit

Permalink
Fix: wp-scripts command does not generate assets on Windows OS (#38348)
Browse files Browse the repository at this point in the history
* Fix: wp-scripts command does not generate assets on Windows OS

* Add CHANGELOG entry

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
  • Loading branch information
t-hamano and gziolo committed Jan 31, 2022
1 parent a060ce5 commit a406895
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## 20.0.2 (2022-01-31)

### Bug Fix

- Fix the `build` command that does not generate assets on Windows OS [#38348](https://github.com/WordPress/gutenberg/pull/38348).

## 20.0.1 (2022-01-28)

### Bug Fix
Expand Down
3 changes: 2 additions & 1 deletion packages/scripts/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ function getWebpackEntryPoints() {
const blockMetadataFiles = glob( 'src/**/block.json', {
absolute: true,
} );

if ( blockMetadataFiles.length > 0 ) {
return blockMetadataFiles.reduce(
( accumulator, blockMetadataFile ) => {
Expand All @@ -202,7 +203,7 @@ function getWebpackEntryPoints() {
const filepath = join(
dirname( blockMetadataFile ),
value.replace( 'file:', '' )
);
).replace( /\\/g, '/' );

// Takes the path without the file extension, and relative to the `src` directory.
const [ , entryName ] = filepath
Expand Down

0 comments on commit a406895

Please sign in to comment.