Skip to content

Commit

Permalink
More passthrough copy docs updates for 11ty/eleventy#2456
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jun 24, 2022
1 parent 34e9db0 commit 7003204
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/docs/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = function(eleventyConfig) {

If you do not want to maintain the same directory structure, [change the output directory.](#change-the-output-directory)

{% addedin "0.11.0" %}Pass-through copy is now friendly to [incremental builds](/docs/usage/incremental/#passthrough-copy). Changes to copied files will not trigger a full build and changes to template files will not trigger passthrough file copy.
{% addedin "2.0.0" %}Passthrough file copy is [emulated when using `--serve`](#passthrough-during-serve).

### How Input Directories are Handled

Expand Down Expand Up @@ -155,7 +155,9 @@ You might want to use this for images by adding `"jpg"`, `"png"`, or maybe even

## Passthrough during `--serve`{% addedin "2.0.0" %}

New in Eleventy `2.0.0-canary.12`: passthrough file copy is _emulated_ when using the [Eleventy Dev Server](/docs/watch-serve/#eleventy-dev-server). Practically speaking, this means that passthrough copy files will not be copied to your output folder and will not impact local development build times. Changes made to passthrough copy files _will_ still hot reload your web browser as expected.
New in Eleventy `2.0.0-canary.12`: passthrough file copy is _emulated_ when using the [Eleventy Dev Server](/docs/watch-serve/#eleventy-dev-server).

Practically speaking, this means that passthrough copy files _**will not**_ be copied to your output folder and will not impact local development build times. Changes made to passthrough copy files _will_ still hot reload your web browser as expected.

This behavior will revert if:

Expand All @@ -173,6 +175,8 @@ module.exports = function(eleventyConfig) {
};
```

* [Issue #2456](https://github.com/11ty/eleventy/issues/2456)

## Passthrough all Content {% addedin "0.5.4" %}

Given that global copy of all content in the directory may be a security risk, we do not copy anything that doesn’t match the file extensions listed in `templateFormats`. Note that we do provide a command line flag to bypass this behavior: `--passthroughall`. Intentionally, there is no configuration option to do this.
Expand Down
7 changes: 4 additions & 3 deletions src/docs/usage-incremental.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Incremental builds via the command line flag `--incremental` have been available

## [Passthrough Copy](/docs/copy/)

* Incremental passthrough copy (✅ available in 0.11.0+) uses the following rules:
* {% addedin "0.11.0" %} Incremental passthrough copy uses the following rules:
* Only copy a passthrough copy file when it actively changed. Don’t run a template build if only a passthrough copy file has changed.
* If a template has changed, don’t copy the passthrough copy files.
* Some discussion about making this behavior default at [Issue #1109](https://github.com/11ty/eleventy/issues/1109). Personally, I’m still on the fence here.
* There was some discussion about making this behavior default at [Issue #1109](https://github.com/11ty/eleventy/issues/1109).
* {% addedin "2.0.0" %} Passthrough copy is now emulated during `--serve` for incremental and non-incremental builds. [Issue #2456](https://github.com/11ty/eleventy/issues/2456)

## Configuration File

Expand All @@ -27,7 +28,7 @@ If you create/update your Eleventy configuration file, a full build will run.

* If you create/update a template file, Eleventy will run the build for that file and only that file.
* If the created/updated file is in your [Includes](/docs/config/#directory-for-includes) or [Layouts](/docs/config/#directory-for-layouts-(optional)) directories, a full build will run.
* This feature is also exposed as part of the API for [Custom template extensions](/docs/languages/custom/) via the `isIncrementalMatch` function (✅ available in 1.0.0+).
* {% addedin "1.0.0" %} This feature is also exposed as part of the API for [Custom template extensions](/docs/languages/custom/) via the `isIncrementalMatch` function.
<!-- * Implemented as part of the Eleventy Vue plugin -->

## 🗓 To Do
Expand Down

0 comments on commit 7003204

Please sign in to comment.