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

Serve passthrough copy files _directly_ during serve without copying to the output folder #2456

Closed
zachleat opened this issue Jun 23, 2022 · 7 comments

Comments

@zachleat
Copy link
Member

zachleat commented Jun 23, 2022

When using --serve or --watch we needn’t copy any passthrough copy files, just serve them directly from the project directory. For standard builds, the files will be copied as normal.

Suggested at 11ty/eleventy-dev-server#12 and #108 (comment)

@zachleat zachleat added this to the Eleventy 2.0.0 milestone Jun 23, 2022
zachleat added a commit that referenced this issue Jun 23, 2022
…ration API method to revert to previous passthrough copy file copy behavior for #2456
@zachleat
Copy link
Member Author

Shipping with 2.0.0-canary.12!

Revert to previous behavior with eleventyConfig.setServerPassthroughCopyBehavior("copy");

@zachleat
Copy link
Member Author

zachleat commented Jun 23, 2022

Passthrough copy no longer triggers a build during --serve or --watch specifically when using the Eleventy Dev Server. Instead, the Dev Server now serves these files directly from the project directory. Changes to passthrough copy files (despite skipping the build) will still trigger a page reload in your browser.

zachleat added a commit to 11ty/eleventy-dev-server that referenced this issue Jun 24, 2022
@zachleat zachleat changed the title Serve passthrough copy files _directly_ during watch/serve without copying to the output folder Serve passthrough copy files _directly_ during serve without copying to the output folder Jun 24, 2022
zachleat added a commit that referenced this issue Jun 24, 2022
zachleat added a commit to 11ty/11ty-website that referenced this issue Jun 24, 2022
@zachleat
Copy link
Member Author

@seb-celinedesign
Copy link

Hi Zach,

thx for this one.

Just tested the Canary 12 version and it doesn't work when passthrough copy with changing output directory like this :
eleventyConfig.addPassthroughCopy({ 'src/public': '/' });

@zachleat
Copy link
Member Author

zachleat commented Dec 8, 2022

@seb-celinedesign make sure to file a new issue if you’re still having a problem!

@TigersWay
Copy link
Contributor

@seb-celinedesign make sure to file a new issue if you’re still having a problem!

@zachleat That issue has been filed some time ago already #2709
Everything else seems to be working but root is still a trouble.

@zachleat
Copy link
Member Author

Note that this option has been swapped to opt-in rather than opt-out in v2.0.0-canary.31.

Docs here: https://www.11ty.dev/docs/copy/#emulate-passthrough-copy-during-serve

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

3 participants