Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--incremental=filename.md for incremental build without --watch or --serve #3324

Closed
LeaVerou opened this issue Jun 17, 2024 · 12 comments
Closed

Comments

@LeaVerou
Copy link

Not sure if this is a bug or a feature request. The --incremental flag is a wonderful thing: instead of rebuilding a whole site, it rebuilds only the files relevant to the one that changed. However, it seems to only be available when running in watch mode. I’ve often needed to only periodically rebuild; I save often and running the watcher often makes my system veeeery sloooow after a while, especially since I have many 11ty websites that I often edit in parallel. However, this also means I lose access to this wonderful feature: even if I were willing to manually specify the file that changed, there is no way to do so.

It would be great if --incremental worked without --watch. It could automatically detect which files have changed by storing the last time it ran somewhere and comparing timestamps. Or, worst case, even if it allowed providing a glob or filename manually, it would still be an immense help.

@zachleat zachleat added this to the Eleventy 3.0.0 milestone Jun 20, 2024
@zachleat zachleat changed the title --incremental is ignored when --watch is not present --incremental=filename.md for incremental build without --watch or --serve Jun 20, 2024
@zachleat
Copy link
Member

v3.0.0-alpha.14 will include support for --incremental=filename to do an incremental build without --watch or --serve.

@zachleat zachleat added the needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. label Jun 20, 2024
@zachleat
Copy link
Member

Work based on the singleTemplateScope feature that was included for the the serverless plugin: b5fc1c3

More background here: https://www.11ty.dev/docs/plugins/serverless/#compile-the-data-cascade-for-the-project

@zachleat zachleat removed the needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. label Jun 20, 2024
@zachleat
Copy link
Member

zachleat commented Jun 20, 2024

Example output from https://github.com/zachleat/zachleat.com:

npx @11ty/eleventy --quiet --incremental=index.liquid
[11ty/eleventy-img] 1 image optimized (1 cached)
[11ty] Wrote 1 file (skipped 481) in 2.12 seconds (v3.0.0-alpha.14)

@zachleat
Copy link
Member

Subscribe to #984 for full cold-start incremental support!

@zachleat
Copy link
Member

Filed related issue for --incremental=glob enhancement here: #3335

@deebloo
Copy link

deebloo commented Jul 26, 2024

hmmmm to get this working with wireit I need to manually figure out that list of changed files

@zachleat
Copy link
Member

zachleat commented Jul 31, 2024

@deebloo can you file an enhancement request? I’m curious if --incremental=filename --to=json works for that use case though

@deebloo
Copy link

deebloo commented Jul 31, 2024

@zachleat maybe I am confused then. --incremental=filename only builds that one file right? I was thinking I would need to pass a list of files to 11ty.

@zachleat
Copy link
Member

@deebloo Ah, no—we’ll generate the dependency map for the file and build the known dependency files too.

@deebloo
Copy link

deebloo commented Jul 31, 2024

gotcha, but if I had two disparate files I would need to do both right? so a.liquid and b.liquid and they had nothing to do with on another. I guess maybe that is my question. When I have multiple pages, do I need to pass those multiple entry files to --incremental?

@zachleat
Copy link
Member

zachleat commented Jul 31, 2024

@deebloo you’d need to run those sequentially until we add support for #3334

@deebloo
Copy link

deebloo commented Jul 31, 2024

gotcha I understand now, thanks! it looks like there are other issues that would handle my use-case

@zachleat zachleat added the needs-documentation Documentation for this issue/feature is pending! label Sep 20, 2024
zachleat added a commit to 11ty/11ty-website that referenced this issue Sep 27, 2024
@zachleat zachleat removed the needs-documentation Documentation for this issue/feature is pending! label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants