diff --git a/Gruntfile.js b/Gruntfile.js index 2ff1b92bf6d7f..ccb4c697954ac 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1219,6 +1219,14 @@ module.exports = function(grunt) { ] ); grunt.registerTask( 'sync-gutenberg-packages', function() { + if ( ! grunt.option( 'dev' ) ) { + console.log( 'You must manually pass the --dev flag to the sync-gutenberg-packages task as follows:' ); + console.log( 'npx grunt sync-gutenberg-packages --dev' ); + console.log( 'Otherwise the webpack build tasks are executed in the production mode and do not '); + console.log( 'regenerate the src/wp-includes/assets/script-loader-packages.php.' ); + process.exit( 0 ); + } + if ( grunt.option( 'update-browserlist' ) ) { /* * Updating the browserlist database is opt-in and up to the release lead. @@ -1248,7 +1256,7 @@ module.exports = function(grunt) { grunt.task.run( 'wp-packages:refresh-deps' ); // Build the files stored in the src/ directory. - grunt.task.run( 'build:dev' ); + grunt.task.run( 'build' ); } ); grunt.renameTask( 'watch', '_watch' ); diff --git a/package.json b/package.json index 4ed33eac1a886..0c3a4715ae716 100644 --- a/package.json +++ b/package.json @@ -175,6 +175,6 @@ "test:php": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit", "test:e2e": "node ./tests/e2e/run-tests.js", "test:visual": "node ./tests/visual-regression/run-tests.js", - "sync-gutenberg-packages": "grunt sync-gutenberg-packages" + "sync-gutenberg-packages": "grunt sync-gutenberg-packages --dev" } }