Skip to content

Commit

Permalink
Build: Fix watching of copied resources (#4237)
Browse files Browse the repository at this point in the history
This addresses issues where resources being passthrough-copied (or
otherwise copied by us in `eleventy.after`) would not update at all
without a full server restart.

This update does not change build output.
  • Loading branch information
kfranqueiro authored Feb 19, 2025
1 parent 9ceac4a commit ba5b725
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eleventy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ export default function (eleventyConfig: any) {
isUnderstanding ? flatGuidelines[resolveUnderstandingFileSlug(page.fileSlug)] : null,
});

// See https://www.11ty.dev/docs/copy/#emulate-passthrough-copy-during-serve
eleventyConfig.setServerPassthroughCopyBehavior("passthrough");

eleventyConfig.addPassthroughCopy("techniques/*.css");
eleventyConfig.addPassthroughCopy("techniques/*/img/*");
eleventyConfig.addPassthroughCopy({
Expand All @@ -249,6 +246,9 @@ export default function (eleventyConfig: any) {
});

eleventyConfig.addPassthroughCopy("working-examples/**");
// working-examples is in .eleventyignore to avoid processing as templates,
// but should still be included as a watch target to pick up changes in dev
eleventyConfig.watchIgnores.add("!working-examples/**");

eleventyConfig.on("eleventy.before", async ({ runMode }: EleventyEvent) => {
// Clear the _site folder before builds intended for the W3C site,
Expand Down

0 comments on commit ba5b725

Please sign in to comment.