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

Cut an Eleventy Dev Server 1.0 #2739

Closed
zachleat opened this issue Jan 10, 2023 · 7 comments
Closed

Cut an Eleventy Dev Server 1.0 #2739

zachleat opened this issue Jan 10, 2023 · 7 comments
Assignees

Comments

@zachleat
Copy link
Member

https://github.com/11ty/eleventy-dev-server

@zachleat zachleat added this to the Eleventy 2.0.0 milestone Jan 10, 2023
@zachleat zachleat self-assigned this Jan 10, 2023
@yurivish
Copy link

(just noticed you're working on this: I might have just encountered a bug with the dev server while testing out the latest canary, involving passthrough paths not being served. I'm working on a minimal reproduction...)

This is the line that's misbehaving (works fine with npm run build but not npm run serve):

eleventyConfig.addPassthroughCopy({'legacy/':'.'});

Works fine with --serve if eleventyConfig.setServerPassthroughCopyBehavior("copy"); is used.

Anyway, thought I'd mention it in case you wanted a cleaner 1.0 that doesn't need an additional bug fixed. :-)

Will have an issue up soon; I just figured out that it has to do with the fact that my legacy directory has subdirectories within it; those get copied over, but not served.

@zachleat
Copy link
Member Author

Make sure you’ve upgraded to the latest canary!

@yurivish
Copy link

yurivish commented Jan 10, 2023

This reproduces on 2.0.0-canary.29. Hmm, my diagnosis might not be correct and I don't have a way to reproduce the issue in isolation yet; will keep you posted.

@yurivish
Copy link

yurivish commented Jan 10, 2023

I figured it out – if the directory that is the target of a passthrough copy has subdirectories, the files do get served if you go to them directly, e.g. the URL http://localhost:8080/mobile-wiki/index.html will serve the index.html file. But the URLs http://localhost:8080/mobile-wiki and http://localhost:8080/mobile-wiki/ will not serve the index.html file if the passthrough copy behavior is "passthrough". Not sure if that qualifies as a bug, but definitely had me chasing this down for a while.

Anyway, I apologize for co-opting your issue! I should have waited and filed a separate issue once I figured out what was going on. Let me know if you'd like me to file this now that I can put up some instructions on how to reproduce it. (And thanks for your work on 2.0 – I've been excited to try it out!)

Edit: Just noticed that this behavior can be reproduced in a simpler setting: 1. Make a passthrough rule that copies a directory, e.g. dir, over, and 2. make sure it has an index.html file inside it. Then if the copy behavior is "passthrough", visiting dir/ will 404 while visiting dir/index.html will not, but if copy behavior is "copy" then both will work.

@zachleat
Copy link
Member Author

No worries @yurivish I did file your issue at 11ty/eleventy-dev-server#43 though I don’t know that it will make 1.0 (dev server)/2.0 (eleventy)!

@zachleat
Copy link
Member Author

This is complete, v1.0 of the Eleventy Dev Server is now available.

@zachleat
Copy link
Member Author

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

2 participants