-
-
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: add headTagInsertCheck warning #16555
feat: add headTagInsertCheck warning #16555
Conversation
Run & review this pull request in StackBlitz Codeflow. |
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.
I guess this warning won't happen that much, but I think the complexity is small enough.
if (!tags.length) return | ||
const { logger } = ctx.server?.config || {} | ||
const message = tags.reduce<string[]>((res, tagDescriptor) => { | ||
if (!HeadElement[tagDescriptor.tag]) res.push(`<${tagDescriptor.tag}>`) |
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.
Note for other reviewers: I confirmed that custom elements are not allowed in <head>
.
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, astro, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, remix, unocss, vike, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-vue, vite-setup-catalogue, vitepress |
Description
add warning message for
applyHtmlTransforms
.there will be an abnormal scene, when we try to use some tags in
head
element, such asdiv
.here is an example:
in browser:
it will be better for developer, if
vite
provide some warn message.