[wp-trac] [WordPress Trac] #59196: Source files are copied onto themselves when running `grunt watch --dev` (`npm run dev`)
WordPress Trac
noreply at wordpress.org
Thu Aug 24 20:25:51 UTC 2023
#59196: Source files are copied onto themselves when running `grunt watch --dev`
(`npm run dev`)
------------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.3.2
Component: Build/Test Tools | Version: 4.4
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+--------------------------
Description changed by westonruter:
Old description:
> 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. After the 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. 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.
New description:
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.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59196#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list