Skip to content

Commit d13c2fc

Browse files
Build: Always load minified VIPS script modules
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.
1 parent bb28d7c commit d13c2fc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/wp-includes/script-modules.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ function wp_default_script_modules() {
190190
wp_interactivity()->add_client_navigation_support_to_script_module( $script_module_id );
191191
}
192192

193+
// VIPS files are always minified — the non-minified versions are not
194+
// shipped because they are ~10MB of inlined WASM with no debugging value.
195+
if ( str_starts_with( $file_name, 'vips/' ) && ! str_contains( $file_name, '.min.' ) ) {
196+
$file_name = str_replace( '.js', '.min.js', $file_name );
197+
}
198+
193199
$path = includes_url( "js/dist/script-modules/{$file_name}" );
194200
$module_deps = $script_module_data['module_dependencies'] ?? array();
195201
wp_register_script_module( $script_module_id, $path, $module_deps, $script_module_data['version'], $args );

0 commit comments

Comments
 (0)