Skip to content

Commit 279fe5c

Browse files
authored
Load .min.js files even in dev mode, generate unminified assets only in prod (WordPress#32621)
1 parent 0e65083 commit 279fe5c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/client-assets.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function gutenberg_register_packages_scripts( $scripts ) {
236236
// When in production, use the plugin's version as the default asset version;
237237
// else (for development or test) default to use the current time.
238238
$default_version = defined( 'GUTENBERG_VERSION' ) && ! ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? GUTENBERG_VERSION : time();
239-
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.js' : '.min.js';
239+
$suffix = '.min.js';
240240

241241
foreach ( glob( gutenberg_dir_path() . "build/*/index$suffix" ) as $path ) {
242242
// Prefix `wp-` to package directory to get script handle.

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ module.exports = {
319319
] )
320320
),
321321
new DependencyExtractionWebpackPlugin( { injectPolyfill: true } ),
322-
new ReadableJsAssetsWebpackPlugin(),
322+
mode === 'production' && new ReadableJsAssetsWebpackPlugin(),
323323
].filter( Boolean ),
324324
watchOptions: {
325325
ignored: [ '**/node_modules', '**/packages/*/src' ],

0 commit comments

Comments
 (0)