diff --git a/Gruntfile.js b/Gruntfile.js
index 32e56cc4cc..8afa3c7767 100644
a
|
b
|
module.exports = function(grunt) { |
11 | 11 | BUILD_DIR = 'build/', |
12 | 12 | BANNER_TEXT = '/*! This file is auto-generated */', |
13 | 13 | autoprefixer = require( 'autoprefixer' ), |
14 | | phpUnitWatchGroup = grunt.option( 'group' ); |
| 14 | phpUnitWatchGroup = grunt.option( 'group' ), |
| 15 | buildFiles = [ |
| 16 | '*.php', |
| 17 | '*.txt', |
| 18 | '*.html', |
| 19 | 'wp-includes/**', // Include everything in wp-includes. |
| 20 | 'wp-admin/**', // Include everything in wp-admin. |
| 21 | 'wp-content/index.php', |
| 22 | 'wp-content/themes/index.php', |
| 23 | 'wp-content/themes/twenty*/**', |
| 24 | 'wp-content/plugins/index.php', |
| 25 | 'wp-content/plugins/hello.php', |
| 26 | 'wp-content/plugins/akismet/**' |
| 27 | ], |
| 28 | cleanFiles = []; |
| 29 | |
| 30 | buildFiles.forEach( function( buildFile ) { |
| 31 | cleanFiles.push( BUILD_DIR + buildFile ); |
| 32 | } ); |
15 | 33 | |
16 | 34 | if ( 'watch:phpunit' === grunt.cli.tasks[ 0 ] && ! phpUnitWatchGroup ) { |
17 | 35 | grunt.log.writeln(); |
… |
… |
module.exports = function(grunt) { |
82 | 100 | } |
83 | 101 | }, |
84 | 102 | clean: { |
85 | | all: [BUILD_DIR], |
| 103 | plugins: [BUILD_DIR + 'wp-content/plugins'], |
| 104 | themes: [BUILD_DIR + 'wp-content/themes'], |
| 105 | all: cleanFiles, |
86 | 106 | js: [BUILD_DIR + 'wp-admin/js/', BUILD_DIR + 'wp-includes/js/'], |
87 | 107 | dynamic: { |
88 | 108 | dot: true, |
… |
… |
module.exports = function(grunt) { |
111 | 131 | dot: true, |
112 | 132 | expand: true, |
113 | 133 | cwd: SOURCE_DIR, |
114 | | src: [ |
115 | | '**', |
| 134 | src: buildFiles.concat( [ |
116 | 135 | '!js/**', // JavaScript is extracted into separate copy tasks. |
117 | | '!**/.{svn,git}/**', // Ignore version control directories. |
| 136 | '!.{svn,git}', // Exclude version control folders. |
118 | 137 | '!wp-includes/version.php', // Exclude version.php |
119 | 138 | '!index.php', '!wp-admin/index.php', |
120 | 139 | '!_index.php', '!wp-admin/_index.php' |
121 | | ], |
| 140 | ] ), |
122 | 141 | dest: BUILD_DIR |
123 | 142 | }, |
124 | 143 | { |