-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
feat(html): support vite-ignore
attribute to opt-out of processing
#18494
Conversation
I welcome any solution! Thank you so much for investing time into this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.external
which 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.external
which 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.external
for deps only for now until we have another usecase for handling relative paths.Questions:
vite-ignore
attribute instead of a comment before the HTML element. Any thoughts here?vite-ignore
attribute is kinda non-standard unless you prepend adata-
, but the PR strips out the attribute anyways so maybe not a problem.