Changeset 61794
- Timestamp:
- 03/03/2026 01:45:29 PM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
src/wp-includes/script-modules.php (modified) (1 diff)
-
tests/phpunit/tests/script-modules/wpScriptModules.php (modified) (1 diff)
-
tools/gutenberg/copy-gutenberg-build.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-modules.php
r61611 r61794 191 191 } 192 192 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 193 199 $path = includes_url( "js/dist/script-modules/{$file_name}" ); 194 200 $module_deps = $script_module_data['module_dependencies'] ?? array(); -
trunk/tests/phpunit/tests/script-modules/wpScriptModules.php
r61587 r61794 1905 1905 1906 1906 /** 1907 * Tests that VIPS script modules always use minified file paths. 1908 * 1909 * Non-minified VIPS files are not shipped because they are ~10MB of 1910 * inlined WASM with no debugging value, so the registration should 1911 * always point to the .min.js variants. 1912 * 1913 * @ticket 64734 1914 * 1915 * @covers ::wp_default_script_modules 1916 */ 1917 public function test_vips_script_modules_always_use_minified_paths() { 1918 wp_default_script_modules(); 1919 wp_enqueue_script_module( '@wordpress/vips/loader' ); 1920 1921 $actual = get_echo( array( wp_script_modules(), 'print_enqueued_script_modules' ) ); 1922 1923 $this->assertStringContainsString( 'vips/loader.min.js', $actual ); 1924 $this->assertStringNotContainsString( 'vips/loader.js"', $actual ); 1925 } 1926 1927 /** 1907 1928 * Normalizes markup for snapshot. 1908 1929 * -
trunk/tools/gutenberg/copy-gutenberg-build.js
r61703 r61794 168 168 copyDirectory( srcPath, destPath, transform, options ); 169 169 } 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 170 185 // Skip PHP files if excludePHP is true 171 186 if ( options.excludePHP && /\.php$/.test( entry.name ) ) {
Note: See TracChangeset
for help on using the changeset viewer.