When using addPassthroughCopy() with a custom destination directory, files nested within the source directory will be copied correctly on the initial run of Eleventy in watch or serve mode, with the --incremental flag. But when one of those nested files are changed in the source directory, it is copied to the root destination directory, without preserving the directory structure.
Using the reproduction repo referenced below, when first starting the --watch or --serve command with the --incremental flag, files are copied as expected:
I would expect modification of src/scripts/lib/hello-world.js to copy the file with its directory structure retained, to dist/scripts/lib/hello-world.js.
Operating system
macOS Sonoma 14.4.1
Eleventy
2.0.1 and 3.0.0-alpha.10
Describe the bug
When using
addPassthroughCopy()
with a custom destination directory, files nested within the source directory will be copied correctly on the initial run of Eleventy inwatch
orserve
mode, with the--incremental
flag. But when one of those nested files are changed in the source directory, it is copied to the root destination directory, without preserving the directory structure.Old, related issue: https://github.com/11ty/eleventy/issues/2297
Reproduction steps
Using the reproduction repo referenced below, when first starting the
--watch
or--serve
command with the--incremental
flag, files are copied as expected:However, if I modify
src/scripts/lib/hello-world.js
, it will be written straight to the destination directory, so it will look like this:Expected behavior
I would expect modification of
src/scripts/lib/hello-world.js
to copy the file with its directory structure retained, todist/scripts/lib/hello-world.js
.Reproduction URL
https://github.com/jsahlen/eleventy-passthrough-incremental
Screenshots
No response