Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Just use assets.php
  • Loading branch information
sirreal committed Sep 20, 2024
commit 1bad15c5c371d239fd7d8669aad58162b2412b08
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ function gutenberg_register_script_modules() {
* 'interactivity/debug.min.js' => array('dependencies' => array(…), 'version' => '…'),
* 'interactivity-router/index.min.js' => …
*/
$assets = include gutenberg_dir_path() . '/build-module/assets.production.php';
$assets = include gutenberg_dir_path() . '/build-module/assets.php';

foreach ( $assets as $file_name => $script_module_data ) {
$package_name = dirname( $file_name );
Expand Down
2 changes: 1 addition & 1 deletion tools/webpack/script-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = {
...plugins,
new DependencyExtractionWebpackPlugin( {
combineAssets: true,
combinedOutputFile: `./assets.${ baseConfig.mode }.php`,
combinedOutputFile: `./assets.php`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge perf win! It will pay off over time. 👏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to remember why there are two versions in WP core:

https://github.com/WordPress/wordpress-develop/blob/35907da95151b45d197102ea4d69e10ad019cab9/tools/webpack/packages.js#L201

All good here. I figured out that in WP core, there are two parallel build processes - one for development and one for production, so they shouldn't be overridden. It isn't the case here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the second thought:

npm run dev

Screenshot 2024-09-20 at 12 14 31

npm run build

Screenshot 2024-09-20 at 12 19 54

Notice the file name difference .js vs .min.js.

} ),
],
watchOptions: {
Expand Down