Skip to content

Build: Exclude non-minified VIPS files from grunt module copy#11281

Closed
adamsilverstein wants to merge 2 commits intoWordPress:trunkfrom
adamsilverstein:fix/build-size
Closed

Build: Exclude non-minified VIPS files from grunt module copy#11281
adamsilverstein wants to merge 2 commits intoWordPress:trunkfrom
adamsilverstein:fix/build-size

Conversation

@adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Mar 18, 2026

Summary

Adds exclusion for non-minified VIPS files in the gutenberg-modules grunt copy task.

Why

The VIPS worker files are ~16 MB of inlined WASM data where minification has negligible effect — worker.js and worker.min.js are nearly identical in size. This filter was already present in tools/gutenberg/copy.js (lines 213-220) but was missing from the Gruntfile grunt copy task that performs the actual module copy during grunt build:gutenberg.

Size impact

Before After Saved
wp-includes/js/dist/script-modules/vips/ ~32 MB (worker.js + worker.min.js) ~16 MB (worker.min.js only) ~16 MB

Related PRs for further size reduction (in Gutenberg)

Test plan

  • Run npx grunt build:gutenberg — verify build/wp-includes/js/dist/script-modules/vips/ contains worker.min.js but NOT worker.js
  • Run PHP tests: vendor/bin/phpunit tests/phpunit/tests/script-modules/wpScriptModules.php

Trac ticket: https://core.trac.wordpress.org/ticket/64884


Commit message

Build: Exclude non-minified VIPS files from grunt module copy.

Add an exclusion for non-minified VIPS files to match the existing filter in `tools/gutenberg/copy.js`. This prevents the ~16 MB `worker.js` from being copied alongside the identically-sized `worker.min.js`, saving ~16 MB from the build output.

Props adamsilverstein, zieladam, desrosj.
Fixes #64884.

The gutenberg-modules grunt copy task copies all files except
.map files. This adds an exclusion for non-minified VIPS files
which are ~16MB of inlined WASM with no debugging value over
the minified versions.

This matches the existing filter in tools/gutenberg/copy.js
and prevents the ~16MB worker.js from being copied alongside
the identically-sized worker.min.js.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 18, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adamsilverstein, zieladam, desrosj.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Contributor

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

Lovely, thank you @adamsilverstein !

@desrosj desrosj self-requested a review March 18, 2026 18:12
@desrosj
Copy link
Member

desrosj commented Mar 18, 2026

Thanks @adamsilverstein!

One note, these files will not explicitly be removed from the build server until Core-64716 is addressed. The files are not cleaned up on the build server before rerunning npm run build with the changed source files, so the files remain under version control.

I am hoping to refresh #11036 shortly to have it in ahead of RC1.

@github-actions
Copy link

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 62055
GitHub commit: 5e8ec8f

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants