Build Tools: Avoid doing copy:dynamic when running grunt watch when using --dev option.

This prevents erroneously copying a file from source onto itself in source.

Props westonruter, jorbin.
Fixes #59196.


git-svn-id: https://develop.svn.wordpress.org/trunk@56461 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2023-08-24 20:40:24 +00:00
parent dfda67a587
commit f085426605

View File

@ -1798,8 +1798,10 @@ module.exports = function(grunt) {
// Clean up only those files that were deleted.
grunt.config( [ 'clean', 'dynamic', 'src' ], src );
} else {
// Otherwise copy over only the changed file.
grunt.config( [ 'copy', 'dynamic', 'src' ], src );
if ( ! grunt.option( 'dev' ) ) {
// Otherwise copy over only the changed file.
grunt.config(['copy', 'dynamic', 'src'], src);
}
// For javascript also minify and validate the changed file.
if ( target === 'js-enqueues' ) {