Opened 14 hours ago
Closed 80 minutes ago
#64884 closed defect (bug) (fixed)
Build: Exclude non-minified VIPS files from grunt module copy
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | Build/Test Tools | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description (last modified by )
Summary
The gutenberg-modules grunt copy task in Gruntfile.js copies all script module files from the Gutenberg build except .map files. However, it does not exclude non-minified VIPS files, which are ~16MB of base64-encoded inlined WASM data. The non-minified worker.js is nearly identical in size to worker.min.js (minification has negligible effect on base64-encoded binary data) and provides no debugging value.
The existing tools/gutenberg/copy.js already has this exclusion (lines 213-220), but the Gruntfile's copy:gutenberg-modules task — which performs the actual module copy during grunt build:gutenberg — was missing the equivalent filter. This results in both worker.js (~16MB) and worker.min.js (~16MB) being included in the build output unnecessarily.
Steps to Reproduce
- Run
npx grunt build:gutenberg - Check
build/wp-includes/js/dist/script-modules/vips/ - Observe both
worker.jsandworker.min.jsare present, nearly identical in size (~16MB each)
Expected Behavior
Only worker.min.js should be present in the build output, since the non-minified version provides no additional value for WASM-inlined content.
Proposed Change
Add a glob exclusion !vips/!(*.min).js to the gutenberg-modules copy task's src array in Gruntfile.js, matching the filter already in tools/gutenberg/copy.js.
PR: https://github.com/WordPress/wordpress-develop/pull/11281
Companion Gutenberg PR: https://github.com/WordPress/gutenberg/pull/76615
Change History (5)
This ticket was mentioned in PR #11281 on WordPress/wordpress-develop by @adamsilverstein.
14 hours ago
#2
@desrosj commented on PR #11281:
12 hours ago
#3
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.
## Summary
Adds exclusion for non-minified VIPS files in the
gutenberg-modulesgrunt copy task.### Why
The VIPS worker files are ~16 MB of inlined WASM data where minification has negligible effect —
worker.jsandworker.min.jsare nearly identical in size. This filter was already present intools/gutenberg/copy.js(lines 213-220) but was missing from the Gruntfile grunt copy task that performs the actual module copy duringgrunt build:gutenberg.### Size impact
wp-includes/js/dist/script-modules/vips/### Related PRs for further size reduction (in Gutenberg)
## Test plan
npx grunt build:gutenberg— verifybuild/wp-includes/js/dist/script-modules/vips/containsworker.min.jsbut NOTworker.jsvendor/bin/phpunit tests/phpunit/tests/script-modules/wpScriptModules.php