diff --git a/Gruntfile.js b/Gruntfile.js index 81da2faae228f..84343d7c7331b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -45,17 +45,28 @@ module.exports = function(grunt) { jsFiles = [ 'wp-admin/js/', 'wp-includes/js/', - 'wp-includes/blocks/**/*.js', - 'wp-includes/blocks/**/*.js.map', + ], + + // All files copied from the Gutenberg repository. + gutenbergFiles = [ + 'wp-includes/assets', + 'wp-includes/build', + // This is redundant given the next line, but included for clarity. + 'wp-includes/script-modules', + 'wp-includes/js/dist', + 'wp-includes/css/dist', + 'wp-includes/blocks/**/*', + '!wp-includes/blocks/index.php', + 'wp-includes/icons', ], // All files built by Webpack, in /src or /build. + // Webpack now only builds Core-specific media files and development scripts. + // Blocks, packages, script modules, and vendors come from the Gutenberg build. webpackFiles = [ - 'wp-includes/assets/*', - 'wp-includes/css/dist', - 'wp-includes/blocks/**/*.css', - '!wp-includes/assets/script-loader-packages.min.php', - '!wp-includes/assets/script-modules-packages.min.php', + 'wp-includes/js/media-*.js', + 'wp-includes/js/media-*.min.js', + 'wp-includes/js/dist/development', ], // All workflow files that should be deleted from non-default branches. @@ -230,13 +241,16 @@ module.exports = function(grunt) { js: jsFiles.map( function( file ) { return setFilePath( WORKING_DIR, file ); } ), + + // Clean files built by Webpack. 'webpack-assets': webpackFiles.map( function( file ) { return setFilePath( WORKING_DIR, file ); } ), - 'interactivity-assets': [ - WORKING_DIR + 'wp-includes/js/dist/interactivity.asset.php', - WORKING_DIR + 'wp-includes/js/dist/interactivity.min.asset.php', - ], + + // Clean files built by the tools/gutenberg scripts. + gutenberg: gutenbergFiles.map( function( file ) { + return setFilePath( WORKING_DIR, file ); + }), dynamic: { dot: true, expand: true, @@ -1708,7 +1722,6 @@ module.exports = function(grunt) { 'clean:webpack-assets', 'webpack:prod', 'webpack:dev', - 'clean:interactivity-assets', ] ); grunt.registerTask( 'build:js', [