mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-09 03:03:18 +00:00
fix(nuxt): include tag attrs for non self-closing tags in tree-shake regex (#6675)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
49acae5f02
commit
a3a8706e43
@ -35,7 +35,7 @@ export const TreeShakeTemplatePlugin = createUnplugin((options: TreeShakeTemplat
|
||||
const s = new MagicString(code)
|
||||
|
||||
// Do not render client-only slots on SSR, but preserve attributes
|
||||
s.replace(COMPONENTS_RE, r => r.replace(/<([^ >]*)[ >][\s\S]*$/, '<$1 />'))
|
||||
s.replace(COMPONENTS_RE, r => r.replace(/<([^>]*[^/])\/?>[\s\S]*$/, '<$1 />'))
|
||||
|
||||
if (s.hasChanged()) {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user