11ty / eleventy-dev-server

A minimal generic web-development web server.
103 stars 19 forks source link

Dev server has to be restarted to passthrough newly added image files #59

Open NathanBowers opened 1 year ago

NathanBowers commented 1 year ago

When adding a new image to a project Eleventy dev server has to be restarted for the new image to be served.

Reproduce:

  1. Have an eleventy project
  2. Add an image folder with some images
  3. Use addPassthroughCopy for those images to your config
  4. Create any html template that would render out an <img> element referencing one of the images in your project
  5. Start server
  6. View your template with <img> in web browser
  7. Add a new image file to your image folder
  8. Add a new <img> element to your html template referencing your newly added image file
  9. The new image will not be available and appears as a broken img src until the dev server is restarted
zachleat commented 6 months ago

Successfully reproduced when using eleventyConfig.setServerPassthroughCopyBehavior("passthrough");

Works as expected with default behavior (eleventyConfig.setServerPassthroughCopyBehavior("copy");)