Incremental Builds Jump to heading
Incremental builds perform a partial build operating only on files that have changed to improve build times when doing local development.
Incremental builds via the command line flag --incremental
have been available without much fanfare in Eleventy for a few versions now. Let’s check in on what the current capabilities of incremental builds are and the plans to improve:
Passthrough Copy Jump to heading
- New in v0.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.
- There was some discussion about making this behavior default at Issue #1109.
- Coming soon in v2.0.0 Passthrough copy is now emulated during
--serve
for incremental and non-incremental builds. Issue #2456
Configuration File Jump to heading
If you create/update your Eleventy configuration file, a full build will run.
Templates Jump to heading
- 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 or Layouts directories, a full build will run.
- New in v1.0.0 This feature is also exposed as part of the API for Custom template extensions via the
isIncrementalMatch
function.
🗓 To Do Jump to heading
Templates Jump to heading
- Smarter dependency map between templates:
- Eleventy layouts
- Publishing into Collections and consuming from Collections
11ty.js
JavaScript dependencies- Global/directory/template Data file usage mapped to templates
- Stretch goal: Pagination-level incremental that operates on a subset of data
- Stretch goal: Work with include/extend/import/macro specific features of template languages.
Smarter Template Language Support Jump to heading
- Liquid
- Nunjucks
Cold Start Jump to heading
Currently incremental does a full build to start out to provide a fresh starting point to work from. Improvements will save the state of the build to a cache for faster cold starts. Issue #984