Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/wp-build/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Breaking Changes

- `@wordpress/boot`, `@wordpress/route`, `@wordpress/theme`, and `@wordpress/private-apis` are no longer bundled. They are now expected to be provided by WordPress Core (7.0+) or the Gutenberg plugin.

### Enhancements

- Avoid unexpected results when typecasting `IS_GUTENBERG_PLUGIN` and `IS_WORDPRESS_CORE` values to Booleans ([#75844](https://github.com/WordPress/gutenberg/pull/75844)).
Expand Down
45 changes: 0 additions & 45 deletions packages/wp-build/lib/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1821,51 +1821,6 @@ async function buildAll( baseUrlExpression ) {
};
} );

// Bundle boot, route, and theme packages from node_modules when pages exist
if ( pageData.length > 0 ) {
try {
const { createRequire } = await import( 'module' );
const require = createRequire( import.meta.url );

// Resolve the @wordpress packages directory from node_modules
const bootPackageJson = require.resolve(
'@wordpress/boot/package.json',
{ paths: [ ROOT_DIR ] }
);
const wordpressPackagesDir = path.dirname(
path.dirname( bootPackageJson )
);

// Bundle boot, route, theme, and private-apis packages
const externalPackages = [
'boot',
'route',
'theme',
'private-apis',
];
for ( const pkgName of externalPackages ) {
const result = await bundlePackage( pkgName, {
sourceDir: wordpressPackagesDir,
handlePrefix: 'wp',
scriptGlobal: 'wp',
packageNamespace: 'wordpress',
} );

if ( result && result.modules ) {
modules.push( ...result.modules );
}
if ( result && result.scripts ) {
scripts.push( ...result.scripts );
}
}
} catch ( error ) {
console.warn(
'\n⚠️ Warning: Could not bundle WordPress packages for pages:',
error.message
);
}
}

console.log( '\n📄 Generating PHP registration files...\n' );
const phpReplacements = await getPhpReplacements(
ROOT_DIR,
Expand Down
Loading