Skip to content

Commit

Permalink
Revert "Build: Use .min.js extension for bundled JavaScript (#23926)"…
Browse files Browse the repository at this point in the history
… (#24239)

This reverts commit 40c6c8f7d1b88ca79f19cadd0c75b34b33803aa8.
  • Loading branch information
BreadGuy007 committed Jul 28, 2020
1 parent 38059ff commit 4817afe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function gutenberg_override_translation_file( $file, $handle ) {
}

// Ignore scripts that are not found in the expected `build/` location.
$script_path = gutenberg_dir_path() . 'build/' . substr( $handle, 3 ) . '/index.min.js';
$script_path = gutenberg_dir_path() . 'build/' . substr( $handle, 3 ) . '/index.js';
if ( ! file_exists( $script_path ) ) {
return $file;
}
Expand Down Expand Up @@ -247,9 +247,9 @@ function gutenberg_register_vendor_scripts( $scripts ) {
* @param WP_Scripts $scripts WP_Scripts instance.
*/
function gutenberg_register_packages_scripts( $scripts ) {
foreach ( glob( gutenberg_dir_path() . 'build/*/index.min.js' ) as $path ) {
foreach ( glob( gutenberg_dir_path() . 'build/*/index.js' ) as $path ) {
// Prefix `wp-` to package directory to get script handle.
// For example, `…/build/a11y/index.min.js` becomes `wp-a11y`.
// For example, `…/build/a11y/index.js` becomes `wp-a11y`.
$handle = 'wp-' . basename( dirname( $path ) );

// Replace `.js` extension with `.asset.php` to find the generated dependencies file.
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
}, {} ),
output: {
devtoolNamespace: 'wp',
filename: './build/[basename]/index.min.js',
filename: './build/[basename]/index.js',
path: __dirname,
library: [ 'wp', '[name]' ],
libraryTarget: 'this',
Expand Down

0 comments on commit 4817afe

Please sign in to comment.