From 32418359ab4b7ab0f415643097ac3960c41ab886 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 18 Feb 2026 10:01:44 +0100 Subject: [PATCH] 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 --- tools/gutenberg/build-gutenberg.js | 6 +++--- tools/gutenberg/copy-gutenberg-build.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/gutenberg/build-gutenberg.js b/tools/gutenberg/build-gutenberg.js index cf6dd973953bc..1dc1f73a4ec69 100644 --- a/tools/gutenberg/build-gutenberg.js +++ b/tools/gutenberg/build-gutenberg.js @@ -145,10 +145,10 @@ async function main() { // On Unix, arguments are passed directly without shell parsing const baseUrlArg = process.platform === 'win32' - ? '--base-url="includes_url( \'build\' )"' - : "--base-url=includes_url( 'build' )"; + ? '--base-url="includes_url( \'build/\' )"' + : "--base-url=includes_url( 'build/' )"; - await exec( 'npm', [ 'run', 'build', '--', '--fast', baseUrlArg ], { + await exec( 'npm', [ 'run', 'build', '--', '--skip-types', baseUrlArg ], { cwd: gutenbergDir, } ); diff --git a/tools/gutenberg/copy-gutenberg-build.js b/tools/gutenberg/copy-gutenberg-build.js index e5332f806f74a..dda8ab39d630e 100644 --- a/tools/gutenberg/copy-gutenberg-build.js +++ b/tools/gutenberg/copy-gutenberg-build.js @@ -39,7 +39,7 @@ const COPY_CONFIG = { // PHP infrastructure files (to wp-includes/build/) phpInfrastructure: { destination: 'build', - files: [ 'routes.php', 'pages.php' ], + files: [ 'routes.php', 'pages.php', 'constants.php' ], directories: [ 'pages', 'routes' ], },