-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Don’t require passthroughCopy for vite assets #2
Comments
I noticed that the Vite postprocessing step already discards unused files from the 11ty build. A (maybe silly) idea to consider is having this plugin copy the whole input directory (excluding files that 11ty already ignores) and let Vite figure out what to do with those resources. For instance: // .eleventy.js
const EleventyVitePlugin = require("@11ty/eleventy-plugin-vite")
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("src")
eleventyConfig.addPlugin(EleventyVitePlugin)
return {
dir: {
input: "src",
},
}
} Given this config, things behave more like I'd expect from Vite. I can have an HTML template that references co-located assets for Vite to process, and files in I imagine this plugin could do something like this internally, albeit with consideration for excluding |
Just a small note that this behavior has likely changed with https://www.11ty.dev/docs/copy/#passthrough-during-serve Relevant: #9 |
Is this still an open issue? I am currently struggling with the basis set-up of my project, because I don't want to add pass trough copies for all the assets I wanna pass to Vite. What's the best practice here? |
I'm struggling with a related problem right now. Before adding the |
@asbjornu files that will not be touched by Vite should be in the Assets that will be touched can be placed anywhere but must also have an |
@KiwiKilian, yep – that fixed it. 🎉 Thanks! 🙏🏼 |
Automatically add a bunch-o-static asset extensions to passthrough copy so that folks don’t have to do it manually. Feedback from https://twitter.com/the_ross_man/status/1504888464076120074
The text was updated successfully, but these errors were encountered: