feat(html): support vite-ignore attribute to opt-out of processing#18494
feat(html): support vite-ignore attribute to opt-out of processing#18494
vite-ignore attribute to opt-out of processing#18494Conversation
|
I welcome any solution! Thank you so much for investing time into this! |
patak-cat
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for adding support for this, it will relieve a lot of users.
My vote goes to the clean vite-ignore, or if we want to make it look a bit more different than other attrs, we could go with something like __vite-ignore 🤔
Do you know of tools that could complain with non-standard attributes?
https://validator.w3.org/ is often the one pointing out these issues, but I think as long as |
sapphi-red
left a comment
There was a problem hiding this comment.
With an attribute, it's impossible to only process some of the attributes. For example, when I have a video tag like below
<video
src="./video.mp4"
poster="./thumbnail.png"
/>and only want to process the poster attribute.
But I think that is rare, and I don't have an alternative so I'm good with going with an attribute.
|
That is a good point. I think if there is enough demand we could say |
|
Is there a timeline for the integration of this feature into release? Neither the current tagged version nor the 6.0.0 beta has this feature implemented. |
|
It is already released in the beta. Can you explain what isn't working? |
Ignore my comment, whoops. I wrongly attributed Vite breaking my script to it ignoring |
Description
Supersedes and closes #11854
Fixes #11017
Fixes #8976
Fixes #3533
This new attribute should also unblock #11138
cc @leonheess
build.rollupOptions.externalwhich is a Rollup-specific build option, but the feature should apply generically in dev too. (e.g. for skipping pre-transforming)resolve.external(which now the environment API has laid the foundation), but the option needs a bit more polish as it only works for dependencies, not relative paths.resolve.externalwhich would've took a lot of work, this PR implements ignores for HTML only to address the linked issues for now. I think it's also helpful to ignore directly on the element instead of through a separate config.resolve.externalfor deps only for now until we have another usecase for handling relative paths.Questions:
vite-ignoreattribute instead of a comment before the HTML element. Any thoughts here?vite-ignoreattribute is kinda non-standard unless you prepend adata-, but the PR strips out the attribute anyways so maybe not a problem.