Skip to content

Commit bb28d7c

Browse files
Build: Exclude .map and non-minified VIPS files during Gutenberg copy
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.
1 parent 6c22d69 commit bb28d7c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tools/gutenberg/copy-gutenberg-build.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,21 @@ function copyDirectory( src, dest, transform = null, options = {} ) {
167167

168168
copyDirectory( srcPath, destPath, transform, options );
169169
} else {
170+
// Skip source map files (.map) — these are not useful in Core
171+
// and the sourceMappingURL references are already stripped from JS files.
172+
if ( /\.map$/.test( entry.name ) ) {
173+
continue;
174+
}
175+
176+
// Skip non-minified VIPS files — they are ~10MB of inlined WASM
177+
// with no debugging value over the minified versions.
178+
if (
179+
srcPath.includes( '/vips/' ) &&
180+
/(?<!\.min)\.js$/.test( entry.name )
181+
) {
182+
continue;
183+
}
184+
170185
// Skip PHP files if excludePHP is true
171186
if ( options.excludePHP && /\.php$/.test( entry.name ) ) {
172187
continue;

0 commit comments

Comments
 (0)