eleventy-dev-server
eleventy-dev-server copied to clipboard
Dev server has to be restarted to passthrough newly added image files
When adding a new image to a project Eleventy dev server has to be restarted for the new image to be served.
- This is using
.addPassthroughCopy("src/img/**/*.{png,gif,jpg,jpeg,pdf,svg,webp}");
ineleventy.js
- Eleventy version: @11ty/[email protected]
- Tried server with and without
--incremental
and it didn't help.
Reproduce:
- Have an eleventy project
- Add an image folder with some images
- Use addPassthroughCopy for those images to your config
- Create any html template that would render out an
<img>
element referencing one of the images in your project - Start server
- View your template with
<img>
in web browser - Add a new image file to your image folder
- Add a new
<img>
element to your html template referencing your newly added image file - The new image will not be available and appears as a broken img src until the dev server is restarted
Successfully reproduced when using eleventyConfig.setServerPassthroughCopyBehavior("passthrough");
Works as expected with default behavior (eleventyConfig.setServerPassthroughCopyBehavior("copy");
)