From a1df97b9057cb2c935b38db61fc4661e0b379bd5 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 27 Jan 2026 22:51:03 -0800 Subject: [PATCH 1/2] Build/Test Tools: Optimize `uglify:core` glob pattern. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `uglify:core` task utilizes a negative glob pattern `!**/*.min.js` to prevent re-minifying already minified files. In development builds (`npm run build:dev`), this pattern operates relative to the `src/` directory. Consequently, the glob expansion scans the entire `src/` directory tree, including `wp-content`. For environments where `wp-content` contains deep directory structures—such as plugins with `node_modules` dependencies—this traversal becomes prohibitively slow, causing the build process to hang. This change scopes the exclusion pattern to `!{wp-admin,wp-includes}/**/*.min.js`, limiting the file scan to the relevant core directories and preventing unnecessary recursion into `wp-content`. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index a17c36e1b940b..8818dc53116a8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -926,7 +926,7 @@ module.exports = function(grunt) { 'wp-includes/js/tinymce/plugins/wp*/plugin.js', // Exceptions. - '!**/*.min.js', + '!{wp-admin,wp-includes}/**/*.min.js', '!wp-admin/js/custom-header.js', // Why? We should minify this. '!wp-admin/js/farbtastic.js', '!wp-includes/js/wp-emoji-loader.js', // This is a module. See the emoji-loader task below. From c4132063767af81ebe9993fb9ffe2b0314f99896 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 28 Jan 2026 09:00:20 -0800 Subject: [PATCH 2/2] Build/Test Tools: Optimize `copy:files` glob pattern. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `copy:files` task utilizes a negative glob pattern `!**/*.map` to exclude source map files from the build. In development builds, this pattern operates relative to the `src/` directory. Consequently, the glob expansion scans the entire `src/` directory tree, including `wp-content`. For environments where `wp-content` contains deep directory structures—such as plugins with `node_modules` dependencies—this traversal becomes prohibitively slow. This change scopes the exclusion pattern to `!{wp-admin,wp-includes,wp-content/themes/twenty*,wp-content/plugins/akismet}/**/*.map`, limiting the file scan to the relevant core directories and preventing unnecessary recursion into `wp-content`. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8818dc53116a8..33cc40ac878dc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -287,7 +287,7 @@ module.exports = function(grunt) { '!wp-includes/certificates/legacy-1024bit.pem', '!.{svn,git}', // Exclude version control folders. '!wp-includes/version.php', // Exclude version.php. - '!**/*.map', // The build doesn't need .map files. + '!{wp-admin,wp-includes,wp-content/themes/twenty*,wp-content/plugins/akismet}/**/*.map', // The build doesn't need .map files. '!index.php', '!wp-admin/index.php', '!_index.php', '!wp-admin/_index.php' ] ),