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

addPassthroughCopy ignores files created after Dev Server start #3007

Open
sentience opened this issue Jul 25, 2023 · 0 comments
Open

addPassthroughCopy ignores files created after Dev Server start #3007

sentience opened this issue Jul 25, 2023 · 0 comments

Comments

@sentience
Copy link

sentience commented Jul 25, 2023

Operating system

macOS Ventura 13.4.1 (c)

Eleventy

2.0.1

Describe the bug

When Eleventy is configured with an addPassthroughCopy, but the file has not yet been created when the initial Dev Server build occurs, Eleventy Dev Server ignores the file when it is created and fails to copy/serve it.

This presents a problem when using a separate process (e.g. postcss-cli) to generate files in development that need to be live-reloaded by Eleventy Dev Server. If the separate process doesn't start up quickly enough and generate its initial output before Eleventy Dev Server first looks for source files, the generated files are ignored.

Reproduction steps

  1. Clone https://github.com/sentience/eleventy-postcss-issue-demo
  2. npm i
  3. npm start
  4. Wait 5 seconds for the initial PostCSS build to complete.
  5. Visit http://localhost:8080/ and note the text "This is a test." appears without the blue background color specified in the styles/styles.css file.
  6. Stop the Dev Server with Ctrl-C.
  7. npm start
  8. Wait 5 seconds for the initial PostCSS build to complete.
  9. Visit http://localhost:8080/ and this time note that the styles display correctly, because _tmp/styles.css already exists from the previous Dev Server run.

Expected behavior

Eleventy Dev Server should monitor for the creation of the source file specified in the addPassthroughCopy (_tmp/styles.css) if it doesn't exist at first. As soon as the file is created, Eleventy Dev Server should serve it when requested.

Reproduction URL

https://github.com/sentience/eleventy-postcss-issue-demo

Screenshots

No response

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

1 participant