Should passthroughFileCopy be necessary here if the method is used?
I don't think it should be necessary.
If I use the method explicitly, I'd get upset if those files weren't copied automatically, and I probably wouldn't think to check that config value. I'd assume the method would override the config.
Of course, passthroughFileCopy = true by default, so I'd probably notice it in the same config file. If there were a CLI flag for passthroughFileCopy, I may not think to look there (e.g. package.json scripts or netlify build scripts that I wouldn't think to check).
I never use passthroughFileCopy myself, always use addPassthroughCopy from a config file. I'd guess that most people probably use one or the other and rarely both. But I may be wrong.
I just tested this and it is not required, as I was hoping. We can close this.
More specifically,

copies the img directory when you run npx eleventy in the project.
Time to update the docs?
Ah thanks for the nudge @reubenlillie鈥攄ocs are now updated!
Cool, no more need for discussion :)
(For the record the only Label that matters on Closed tickets is Needs Votes 馃槑 so I鈥檒l probably just leave the label in place 馃槆)
Just one more comment here as I review the source code and ran across this and was confused for a moment.
The reason this works out of the box is that default value for passthroughFileCopy in the Eleventy supplied default configuration is true.
So while this works and copies img (as we want and as is expected):
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("img");
};
The following will _not_ copy img (which is also correct behavior):
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("img");
return {
passthroughFileCopy: false
};
};
The default option is also documented on https://www.11ty.io/docs/config/#copy-files-to-output-using-pass-through-file-copy
Rewrote the docs to reflect that it鈥檚 on by default (they were written the other way)
https://www.11ty.io/docs/copy/
Also filed #597 to remove the public option to disable this, I think it鈥檚 unnecessary. Comment over there if you disagree.
Most helpful comment
I don't think it should be necessary.
If I use the method explicitly, I'd get upset if those files weren't copied automatically, and I probably wouldn't think to check that config value. I'd assume the method would override the config.
Of course,
passthroughFileCopy = trueby default, so I'd probably notice it in the same config file. If there were a CLI flag forpassthroughFileCopy, I may not think to look there (e.g. package.json scripts or netlify build scripts that I wouldn't think to check).I never use
passthroughFileCopymyself, always useaddPassthroughCopyfrom a config file. I'd guess that most people probably use one or the other and rarely both. But I may be wrong.