diff --git a/packages/plugin-vue/src/template.ts b/packages/plugin-vue/src/template.ts index a29874d0ed2cff..25da54203e6214 100644 --- a/packages/plugin-vue/src/template.ts +++ b/packages/plugin-vue/src/template.ts @@ -134,11 +134,7 @@ export function resolveTemplateCompilerOptions( if (transformAssetUrls && typeof transformAssetUrls === 'object') { // presence of array fields means this is raw tags config - if ( - Object.keys(transformAssetUrls).some((key) => - Array.isArray((transformAssetUrls as any)[key]) - ) - ) { + if (Object.values(transformAssetUrls).some((val) => Array.isArray(val))) { transformAssetUrls = { ...assetUrlOptions, tags: transformAssetUrls as any diff --git a/packages/vite/src/client/client.ts b/packages/vite/src/client/client.ts index 5c04bc23af0cc1..15c86910aa3848 100644 --- a/packages/vite/src/client/client.ts +++ b/packages/vite/src/client/client.ts @@ -78,10 +78,8 @@ async function handleMessage(payload: HMRPayload) { // can't use querySelector with `[href*=]` here since the link may be // using relative paths so we need to use link.href to grab the full // URL for the include check. - const el = ( - [].slice.call( - document.querySelectorAll(`link`) - ) as HTMLLinkElement[] + const el = Array.from( + document.querySelectorAll('link') ).find((e) => e.href.includes(path)) if (el) { const newPath = `${base}${path.slice(1)}${