Build: Reduce VIPS build size by excluding .map and non-minified files#11109
Build: Reduce VIPS build size by excluding .map and non-minified files#11109adamsilverstein wants to merge 5 commits intoWordPress:trunkfrom
Conversation
Source map files serve no purpose in Core since sourceMappingURL references are already stripped. Non-minified VIPS files are ~10MB of inlined WASM with no debugging value. Saves ~30MB total.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
@youknowriad maybe simpler to exclude here for now? |
Non-minified VIPS files are excluded from the build since they are ~10MB of inlined WASM with no debugging value. This ensures SCRIPT_DEBUG mode still resolves to the minified versions that exist on disk.
|
This worked well in my testing, committing. |
Summary
.mapsource map files incopyDirectory()— sourceMappingURL references are already stripped from JS files by the existingremoveSourceMapstransform, so the.mapfiles serve no purpose in Corewp_default_script_modules(), soSCRIPT_DEBUGmode resolves to the.min.jsfiles that exist on diskFixes https://core.trac.wordpress.org/ticket/64734
Test plan
node tools/gutenberg/copy-gutenberg-build.jsand verify no.mapfiles are copiedworker.min.js,loader.min.js, asset PHP files)SCRIPT_DEBUGenabledTrac ticket: https://core.trac.wordpress.org/ticket/64734