Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#59196 closed defect (bug) (fixed)

Source files are copied onto themselves when running `grunt watch --dev` (`npm run dev`)

Reported by: westonruter Owned by: westonruter
Priority: normal Milestone: 6.3.2
Component: Build/Test Tools Version: 4.4
Severity: normal Keywords: has-patch fixed-major
Cc: Focuses:

Description (last modified by westonruter)

In the wordpress-develop repo, I have a plugin file located in src/wp-content/plugins/. I've also initiated npm run dev (grunt watch --dev). I noticed in PhpStorm when editing the plugin file that often the editor complains about the file being modified on disk and whether I want to reload the file or use the copy in memory. What I think is happening is that the editor is I'll make a change and save and then I'll make another change and save again after a couple seconds. After the first save, the watch command picks up on the change to the file and it is copying the file onto itself and thus bumping the modified time, causing the editor to detect a conflict at the second save. It turns out that this is not only the case for files in src/wp-content/plugins but all source files. It seems that grunt watch is erroneously copying source files onto itself when using the --dev option.

Attachments (1)

Screenshot 2023-08-24 16.24.48.png​ (71.2 KB ) - added by westonruter 3 years ago.
Screenshot of PhpStorm showing issue

Download all attachments as: .zip

Change History (7)

#1 @westonruter
3 years ago

  • Description modified (diff)

This ticket was mentioned in ​PR #5082 on ​WordPress/wordpress-develop by ​@westonruter.


3 years ago
#2

  • Keywords has-patch added

#3 @westonruter
3 years ago

  • Resolution → fixed
  • Status assigned → closed

In 56461:

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.

​@westonruter commented on ​PR #5082:


3 years ago
#4

Committed in r56461

#5 @westonruter
3 years ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closed → reopened

Reopening for 6.3.2 consideration.

#6 @audrasjb
3 years ago

  • Resolution → fixed
  • Status reopened → closed

In 56782:

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.
Merges [56461] to the 6.3 branch.
Fixes #59196.

Note: See TracTickets for help on using tickets.