Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1708,7 +1722,6 @@ module.exports = function(grunt) {
'clean:webpack-assets',
'webpack:prod',
'webpack:dev',
'clean:interactivity-assets',
] );

grunt.registerTask( 'build:js', [
Expand Down
Loading