From ce21d8210a0c688ec94b3d4002fb38cff10574d6 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Thu, 20 Oct 2016 22:23:21 +0000 Subject: [PATCH] Build/Test Tools: Allow Minimal Builds Builds can hang or get very slow on copy when you have alot of files. Alot of files can suddenly appear when you are developing new themes or plugins. Often, it's nice to have a minimal build, especially if you are preparing a commit. This adds a new flag `--minimal-copy` that can be added to any task which does a copy. These tasks include build, test, and copy. This flag will cause no plugins to be copied and only the twenty series of default themes to be copied. Everything else remains the same. Fixes #38423. git-svn-id: https://develop.svn.wordpress.org/trunk@38848 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index adc9c0d6b3..7a002fdafd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -645,6 +645,15 @@ module.exports = function(grunt) { } }); + // Allow builds to be minimal + if( grunt.option( 'minimal-copy' ) ) { + var copyFilesOptions = grunt.config.get( 'copy.files.files' ); + copyFilesOptions[0].src.push( '!wp-content/plugins/**' ); + copyFilesOptions[0].src.push( '!wp-content/themes/!(twenty*)/**' ); + grunt.config.set( 'copy.files.files', copyFilesOptions ); + } + + // Register tasks. // RTL task.