Skip to content

Commit e0f8d7e

Browse files
youknowriadclaude
andcommitted
Build: Fix Gutenberg copy script missing constants.php and incorrect base URL.
The copy script was not including `constants.php` in the list of PHP infrastructure files to sync from Gutenberg's build output to Core. Additionally, the base URL passed to the Gutenberg build had the trailing slash outside the `includes_url()` call, resulting in URLs like `build/pages` being generated as `buildpages`. Props youknowriad. Fixes #64656. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 452f0d3 commit e0f8d7e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tools/gutenberg/build-gutenberg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ async function main() {
145145
// On Unix, arguments are passed directly without shell parsing
146146
const baseUrlArg =
147147
process.platform === 'win32'
148-
? '--base-url="includes_url( \'build\' )"'
149-
: "--base-url=includes_url( 'build' )";
148+
? '--base-url="includes_url( \'build/\' )"'
149+
: "--base-url=includes_url( 'build/' )";
150150

151151
await exec( 'npm', [ 'run', 'build', '--', '--fast', baseUrlArg ], {
152152
cwd: gutenbergDir,

tools/gutenberg/copy-gutenberg-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const COPY_CONFIG = {
3939
// PHP infrastructure files (to wp-includes/build/)
4040
phpInfrastructure: {
4141
destination: 'build',
42-
files: [ 'routes.php', 'pages.php' ],
42+
files: [ 'routes.php', 'pages.php', 'constants.php' ],
4343
directories: [ 'pages', 'routes' ],
4444
},
4545

0 commit comments

Comments
 (0)