diff --git a/Gruntfile.js b/Gruntfile.js index 4be458980b..a24e701e06 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1546,8 +1546,14 @@ module.exports = function(grunt) { * @ticket 46218 */ grunt.registerTask( 'verify:source-maps', function() { - const path = `${ BUILD_DIR }**/*.js`; - const files = glob.sync( path ); + const files = buildFiles.reduce( ( acc, path ) => { + // Skip excluded paths and any path that isn't a file. + if ( '!' === path[0] || '**' !== path.substr( -2 ) ) { + return acc; + } + acc.push( ...glob.sync( `${ BUILD_DIR }/${ path }/*.js` ) ); + return acc; + }, [] ); assert( files.length > 0,