mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-22 11:22:43 +00:00
feat: @unhead/vue
v2
This commit is contained in:
parent
218d8f1e6c
commit
99d36f1be7
@ -111,7 +111,8 @@ export default defineNuxtModule({
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ts [plugin.ts]
|
```ts [plugin.ts]
|
||||||
import { createHead as createClientHead, createServerHead } from '@unhead/vue'
|
import { createHead as createServerHead } from '@unhead/vue/server'
|
||||||
|
import { createHead as createClientHead } from '@unhead/vue/client'
|
||||||
import { defineNuxtPlugin } from '#imports'
|
import { defineNuxtPlugin } from '#imports'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import metaConfig from '#build/meta.config.mjs'
|
import metaConfig from '#build/meta.config.mjs'
|
||||||
|
14
package.json
14
package.json
@ -40,11 +40,9 @@
|
|||||||
"@nuxt/vite-builder": "workspace:*",
|
"@nuxt/vite-builder": "workspace:*",
|
||||||
"@nuxt/webpack-builder": "workspace:*",
|
"@nuxt/webpack-builder": "workspace:*",
|
||||||
"@types/node": "22.10.5",
|
"@types/node": "22.10.5",
|
||||||
"@unhead/dom": "1.11.15",
|
"@unhead/schema": "2.0.0-alpha.2",
|
||||||
"@unhead/schema": "1.11.15",
|
"@unhead/vue": "2.0.0-alpha.2",
|
||||||
"@unhead/shared": "1.11.15",
|
"@unhead/shared": "2.0.0-alpha.2",
|
||||||
"@unhead/ssr": "1.11.15",
|
|
||||||
"@unhead/vue": "1.11.15",
|
|
||||||
"@vue/compiler-core": "3.5.13",
|
"@vue/compiler-core": "3.5.13",
|
||||||
"@vue/compiler-dom": "3.5.13",
|
"@vue/compiler-dom": "3.5.13",
|
||||||
"@vue/shared": "3.5.13",
|
"@vue/shared": "3.5.13",
|
||||||
@ -61,7 +59,7 @@
|
|||||||
"typescript": "5.7.3",
|
"typescript": "5.7.3",
|
||||||
"ufo": "1.5.4",
|
"ufo": "1.5.4",
|
||||||
"unbuild": "3.2.0",
|
"unbuild": "3.2.0",
|
||||||
"unhead": "1.11.15",
|
"unhead": "2.0.0-alpha.2",
|
||||||
"unimport": "3.14.5",
|
"unimport": "3.14.5",
|
||||||
"vite": "6.0.7",
|
"vite": "6.0.7",
|
||||||
"vue": "3.5.13"
|
"vue": "3.5.13"
|
||||||
@ -77,8 +75,8 @@
|
|||||||
"@testing-library/vue": "8.1.0",
|
"@testing-library/vue": "8.1.0",
|
||||||
"@types/node": "22.10.5",
|
"@types/node": "22.10.5",
|
||||||
"@types/semver": "7.5.8",
|
"@types/semver": "7.5.8",
|
||||||
"@unhead/schema": "1.11.15",
|
"@unhead/schema": "2.0.0-alpha.2",
|
||||||
"@unhead/vue": "1.11.15",
|
"@unhead/vue": "2.0.0-alpha.2",
|
||||||
"@vitest/coverage-v8": "2.1.8",
|
"@vitest/coverage-v8": "2.1.8",
|
||||||
"@vue/test-utils": "2.4.6",
|
"@vue/test-utils": "2.4.6",
|
||||||
"autoprefixer": "10.4.20",
|
"autoprefixer": "10.4.20",
|
||||||
|
@ -71,10 +71,7 @@
|
|||||||
"@nuxt/schema": "workspace:*",
|
"@nuxt/schema": "workspace:*",
|
||||||
"@nuxt/telemetry": "^2.6.4",
|
"@nuxt/telemetry": "^2.6.4",
|
||||||
"@nuxt/vite-builder": "workspace:*",
|
"@nuxt/vite-builder": "workspace:*",
|
||||||
"@unhead/dom": "^1.11.15",
|
"@unhead/vue": "^2.0.0-alpha.2",
|
||||||
"@unhead/shared": "^1.11.15",
|
|
||||||
"@unhead/ssr": "^1.11.15",
|
|
||||||
"@unhead/vue": "^1.11.15",
|
|
||||||
"@vue/shared": "^3.5.13",
|
"@vue/shared": "^3.5.13",
|
||||||
"acorn": "8.14.0",
|
"acorn": "8.14.0",
|
||||||
"c12": "^2.0.1",
|
"c12": "^2.0.1",
|
||||||
@ -118,7 +115,6 @@
|
|||||||
"uncrypto": "^0.1.3",
|
"uncrypto": "^0.1.3",
|
||||||
"unctx": "^2.4.1",
|
"unctx": "^2.4.1",
|
||||||
"unenv": "^1.10.0",
|
"unenv": "^1.10.0",
|
||||||
"unhead": "^1.11.15",
|
|
||||||
"unimport": "^3.14.5",
|
"unimport": "^3.14.5",
|
||||||
"unplugin": "^2.1.2",
|
"unplugin": "^2.1.2",
|
||||||
"unplugin-vue-router": "^0.10.9",
|
"unplugin-vue-router": "^0.10.9",
|
||||||
|
@ -16,16 +16,16 @@ import { stringify, uneval } from 'devalue'
|
|||||||
import destr from 'destr'
|
import destr from 'destr'
|
||||||
import { getQuery as getURLQuery, joinURL, withoutTrailingSlash } from 'ufo'
|
import { getQuery as getURLQuery, joinURL, withoutTrailingSlash } from 'ufo'
|
||||||
import { renderToString as _renderToString } from 'vue/server-renderer'
|
import { renderToString as _renderToString } from 'vue/server-renderer'
|
||||||
import { propsToString, renderSSRHead } from '@unhead/ssr'
|
import { createHead as createServerHead, propsToString, renderSSRHead } from '@unhead/vue/server'
|
||||||
import type { Head, HeadEntryOptions } from '@unhead/schema'
|
import type { Head, HeadEntryOptions } from '@unhead/schema'
|
||||||
import type { Link, Script, Style } from '@unhead/vue'
|
import type { Link, Script, Style } from '@unhead/vue'
|
||||||
import { createServerHead, resolveUnrefHeadInput } from '@unhead/vue'
|
import { resolveUnrefHeadInput } from '@unhead/vue'
|
||||||
|
|
||||||
import { defineRenderHandler, getRouteRules, useNitroApp, useRuntimeConfig, useStorage } from 'nitro/runtime'
|
import { defineRenderHandler, getRouteRules, useNitroApp, useRuntimeConfig, useStorage } from 'nitro/runtime'
|
||||||
import type { NuxtPayload, NuxtSSRContext } from 'nuxt/app'
|
import type { NuxtPayload, NuxtSSRContext } from 'nuxt/app'
|
||||||
|
|
||||||
// @ts-expect-error virtual file
|
// @ts-expect-error virtual file
|
||||||
import unheadPlugins from '#internal/unhead-plugins.mjs'
|
import unheadOptions from '#internal/unhead-options.mjs'
|
||||||
// @ts-expect-error virtual file
|
// @ts-expect-error virtual file
|
||||||
import { renderSSRHeadOptions } from '#internal/unhead.config.mjs'
|
import { renderSSRHeadOptions } from '#internal/unhead.config.mjs'
|
||||||
|
|
||||||
@ -289,9 +289,7 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
|
|||||||
// Get route options (currently to apply `ssr: false`)
|
// Get route options (currently to apply `ssr: false`)
|
||||||
const routeOptions = getRouteRules(event)
|
const routeOptions = getRouteRules(event)
|
||||||
|
|
||||||
const head = createServerHead({
|
const head = createServerHead(unheadOptions)
|
||||||
plugins: unheadPlugins,
|
|
||||||
})
|
|
||||||
|
|
||||||
// needed for hash hydration plugin to work
|
// needed for hash hydration plugin to work
|
||||||
const headEntryOptions: HeadEntryOptions = { mode: 'server' }
|
const headEntryOptions: HeadEntryOptions = { mode: 'server' }
|
||||||
|
@ -12,6 +12,7 @@ export default defineNuxtModule<NuxtOptions['unhead']>({
|
|||||||
},
|
},
|
||||||
async setup (options, nuxt) {
|
async setup (options, nuxt) {
|
||||||
const runtimeDir = resolve(distDir, 'head/runtime')
|
const runtimeDir = resolve(distDir, 'head/runtime')
|
||||||
|
const isNuxtV4 = nuxt.options.future?.compatibilityVersion === 4
|
||||||
|
|
||||||
// Transpile @unhead/vue
|
// Transpile @unhead/vue
|
||||||
nuxt.options.build.transpile.push('@unhead/vue')
|
nuxt.options.build.transpile.push('@unhead/vue')
|
||||||
@ -38,7 +39,7 @@ export default defineNuxtModule<NuxtOptions['unhead']>({
|
|||||||
}
|
}
|
||||||
|
|
||||||
addImportsSources({
|
addImportsSources({
|
||||||
from: '@unhead/vue',
|
from: resolve(runtimeDir, 'composables', isNuxtV4 ? 'v4' : 'v3'),
|
||||||
// hard-coded for now we so don't support auto-imports on the deprecated composables
|
// hard-coded for now we so don't support auto-imports on the deprecated composables
|
||||||
imports: [
|
imports: [
|
||||||
'injectHead',
|
'injectHead',
|
||||||
@ -51,17 +52,21 @@ export default defineNuxtModule<NuxtOptions['unhead']>({
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
// Opt-out feature allowing dependencies using @vueuse/head to work
|
const unheadVue = await tryResolveModule('unhead/plugins', nuxt.options.modulesDir) || 'unhead/plugins'
|
||||||
const unheadVue = await tryResolveModule('@unhead/vue', nuxt.options.modulesDir) || '@unhead/vue'
|
|
||||||
|
|
||||||
addTemplate({
|
addTemplate({
|
||||||
filename: 'unhead-plugins.mjs',
|
filename: 'unhead-options.mjs',
|
||||||
getContents () {
|
getContents () {
|
||||||
if (!nuxt.options.experimental.headNext) {
|
if (isNuxtV4) {
|
||||||
return 'export default []'
|
return `export default {}`
|
||||||
}
|
}
|
||||||
return `import { CapoPlugin } from ${JSON.stringify(unheadVue)};
|
// v1 unhead legacy options
|
||||||
export default import.meta.server ? [CapoPlugin({ track: true })] : [];`
|
const disableCapoSorting = !nuxt.options.experimental.headNext
|
||||||
|
return `import { DeprecationsPlugin, PromisesPlugin } from ${JSON.stringify(unheadVue)};
|
||||||
|
export default {
|
||||||
|
disableCapoSorting: ${disableCapoSorting}
|
||||||
|
plugins: [DeprecationsPlugin, PromisesPlugin],
|
||||||
|
}`
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -76,7 +81,7 @@ export default import.meta.server ? [CapoPlugin({ track: true })] : [];`
|
|||||||
|
|
||||||
// template is only exposed in nuxt context, expose in nitro context as well
|
// template is only exposed in nuxt context, expose in nitro context as well
|
||||||
nuxt.hooks.hook('nitro:config', (config) => {
|
nuxt.hooks.hook('nitro:config', (config) => {
|
||||||
config.virtual!['#internal/unhead-plugins.mjs'] = () => nuxt.vfs['#build/unhead-plugins.mjs']
|
config.virtual!['#internal/unhead-options.mjs'] = () => nuxt.vfs['#build/unhead-options.mjs']
|
||||||
config.virtual!['#internal/unhead.config.mjs'] = () => nuxt.vfs['#build/unhead.config.mjs']
|
config.virtual!['#internal/unhead.config.mjs'] = () => nuxt.vfs['#build/unhead.config.mjs']
|
||||||
})
|
})
|
||||||
|
|
||||||
|
36
packages/nuxt/src/head/runtime/composables/v3.ts
Normal file
36
packages/nuxt/src/head/runtime/composables/v3.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
|
||||||
|
import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from '@unhead/vue'
|
||||||
|
import { useHead as head, useHeadSafe as headSafe, useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe, useServerSeoMeta as serverSeoMeta } from '@unhead/vue'
|
||||||
|
import { tryUseNuxtApp } from '#app'
|
||||||
|
|
||||||
|
interface NuxtUseHeadOptions extends UseHeadOptions {
|
||||||
|
nuxt?: any
|
||||||
|
}
|
||||||
|
|
||||||
|
export function injectHead (nuxtApp?: any) {
|
||||||
|
return (nuxtApp || tryUseNuxtApp())?.runWithContext(() => injectHead())
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useHead<T extends MergeHead> (input: UseHeadInput<T>, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> | void {
|
||||||
|
return (options.nuxt || tryUseNuxtApp()).runWithContext(() => head<T>(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useHeadSafe<T extends MergeHead> (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> | void {
|
||||||
|
return (options.nuxt || tryUseNuxtApp()).runWithContext(() => headSafe(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseSeoMetaInput> | void {
|
||||||
|
return (options.nuxt || tryUseNuxtApp()).runWithContext(() => seoMeta(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useServerHead<T extends MergeHead> (input: UseHeadInput<T>, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> | void {
|
||||||
|
return (options.nuxt || tryUseNuxtApp()).runWithContext(() => serverHead<T>(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useServerHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseSeoMetaInput> | void {
|
||||||
|
return (options.nuxt || tryUseNuxtApp()).runWithContext(() => serverHeadSafe(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useServerSeoMeta<T extends MergeHead> (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> | void {
|
||||||
|
return (options.nuxt || tryUseNuxtApp()).runWithContext(() => serverSeoMeta(input, options))
|
||||||
|
}
|
36
packages/nuxt/src/head/runtime/composables/v4.ts
Normal file
36
packages/nuxt/src/head/runtime/composables/v4.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
|
||||||
|
import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from '@unhead/vue'
|
||||||
|
import { useHead as head, useHeadSafe as headSafe, useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe, useServerSeoMeta as serverSeoMeta } from '@unhead/vue'
|
||||||
|
import { useNuxtApp } from '#app'
|
||||||
|
|
||||||
|
interface NuxtUseHeadOptions extends UseHeadOptions {
|
||||||
|
nuxt?: any
|
||||||
|
}
|
||||||
|
|
||||||
|
export function injectHead (nuxtApp?: any) {
|
||||||
|
return (nuxtApp || useNuxtApp()).runWithContext(() => injectHead())
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useHead<T extends MergeHead> (input: UseHeadInput<T>, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> {
|
||||||
|
return (options.nuxt || useNuxtApp()).runWithContext(() => head<T>(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useHeadSafe<T extends MergeHead> (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> {
|
||||||
|
return (options.nuxt || useNuxtApp()).runWithContext(() => headSafe(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseSeoMetaInput> {
|
||||||
|
return (options.nuxt || useNuxtApp()).runWithContext(() => seoMeta(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useServerHead<T extends MergeHead> (input: UseHeadInput<T>, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> {
|
||||||
|
return (options.nuxt || useNuxtApp()).runWithContext(() => serverHead<T>(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useServerHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseSeoMetaInput> {
|
||||||
|
return (options.nuxt || useNuxtApp()).runWithContext(() => serverHeadSafe(input, options))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useServerSeoMeta<T extends MergeHead> (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry<UseHeadInput<T>> {
|
||||||
|
return (options.nuxt || useNuxtApp()).runWithContext(() => serverSeoMeta(input, options))
|
||||||
|
}
|
@ -1,9 +1,8 @@
|
|||||||
import { createHead as createClientHead, setHeadInjectionHandler } from '@unhead/vue'
|
import { createHead as createClientHead, renderDOMHead } from '@unhead/vue/client'
|
||||||
import { renderDOMHead } from '@unhead/dom'
|
import { defineNuxtPlugin } from '#app/nuxt'
|
||||||
import { defineNuxtPlugin, useNuxtApp } from '#app/nuxt'
|
|
||||||
|
|
||||||
// @ts-expect-error virtual file
|
// @ts-expect-error virtual file
|
||||||
import unheadPlugins from '#build/unhead-plugins.mjs'
|
import unheadOptions from '#build/unhead-options.mjs'
|
||||||
|
|
||||||
export default defineNuxtPlugin({
|
export default defineNuxtPlugin({
|
||||||
name: 'nuxt:head',
|
name: 'nuxt:head',
|
||||||
@ -11,14 +10,7 @@ export default defineNuxtPlugin({
|
|||||||
setup (nuxtApp) {
|
setup (nuxtApp) {
|
||||||
const head = import.meta.server
|
const head = import.meta.server
|
||||||
? nuxtApp.ssrContext!.head
|
? nuxtApp.ssrContext!.head
|
||||||
: createClientHead({
|
: createClientHead(unheadOptions)
|
||||||
plugins: unheadPlugins,
|
|
||||||
})
|
|
||||||
// allow useHead to be used outside a Vue context but within a Nuxt context
|
|
||||||
setHeadInjectionHandler(
|
|
||||||
// need a fresh instance of the nuxt app to avoid parallel requests interfering with each other
|
|
||||||
() => useNuxtApp().vueApp._context.provides.usehead,
|
|
||||||
)
|
|
||||||
// nuxt.config appHead is set server-side within the renderer
|
// nuxt.config appHead is set server-side within the renderer
|
||||||
nuxtApp.vueApp.use(head)
|
nuxtApp.vueApp.use(head)
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/pug": "2.0.10",
|
"@types/pug": "2.0.10",
|
||||||
"@unhead/schema": "1.11.15",
|
"@unhead/schema": "2.0.0-alpha.2",
|
||||||
"@vitejs/plugin-vue": "5.2.1",
|
"@vitejs/plugin-vue": "5.2.1",
|
||||||
"@vitejs/plugin-vue-jsx": "4.1.1",
|
"@vitejs/plugin-vue-jsx": "4.1.1",
|
||||||
"@vue/compiler-core": "3.5.13",
|
"@vue/compiler-core": "3.5.13",
|
||||||
|
@ -122,7 +122,7 @@ export async function buildServer (ctx: ViteBuildContext) {
|
|||||||
if (Array.isArray(serverConfig.ssr!.external)) {
|
if (Array.isArray(serverConfig.ssr!.external)) {
|
||||||
serverConfig.ssr!.external.push(
|
serverConfig.ssr!.external.push(
|
||||||
// explicit dependencies we use in our ssr renderer - these can be inlined (if necessary) in the nitro build
|
// explicit dependencies we use in our ssr renderer - these can be inlined (if necessary) in the nitro build
|
||||||
'unhead', '@unhead/ssr', 'unctx', 'h3', 'devalue', '@nuxt/devalue', 'radix3', 'rou3', 'unstorage', 'hookable',
|
'unhead', 'unctx', 'h3', 'devalue', '@nuxt/devalue', 'radix3', 'rou3', 'unstorage', 'hookable',
|
||||||
// ensure we only have one version of vue if nitro is going to inline anyway
|
// ensure we only have one version of vue if nitro is going to inline anyway
|
||||||
...((ctx.nuxt as any)._nitro as Nitro).options.inlineDynamicImports ? ['vue', '@vue/server-renderer', '@unhead/vue'] : [],
|
...((ctx.nuxt as any)._nitro as Nitro).options.inlineDynamicImports ? ['vue', '@vue/server-renderer', '@unhead/vue'] : [],
|
||||||
// dependencies we might share with nitro - these can be inlined (if necessary) in the nitro build
|
// dependencies we might share with nitro - these can be inlined (if necessary) in the nitro build
|
||||||
|
@ -11,11 +11,9 @@ overrides:
|
|||||||
'@nuxt/vite-builder': workspace:*
|
'@nuxt/vite-builder': workspace:*
|
||||||
'@nuxt/webpack-builder': workspace:*
|
'@nuxt/webpack-builder': workspace:*
|
||||||
'@types/node': 22.10.5
|
'@types/node': 22.10.5
|
||||||
'@unhead/dom': 1.11.15
|
'@unhead/schema': 2.0.0-alpha.2
|
||||||
'@unhead/schema': 1.11.15
|
'@unhead/vue': 2.0.0-alpha.2
|
||||||
'@unhead/shared': 1.11.15
|
'@unhead/shared': 2.0.0-alpha.2
|
||||||
'@unhead/ssr': 1.11.15
|
|
||||||
'@unhead/vue': 1.11.15
|
|
||||||
'@vue/compiler-core': 3.5.13
|
'@vue/compiler-core': 3.5.13
|
||||||
'@vue/compiler-dom': 3.5.13
|
'@vue/compiler-dom': 3.5.13
|
||||||
'@vue/shared': 3.5.13
|
'@vue/shared': 3.5.13
|
||||||
@ -32,7 +30,7 @@ overrides:
|
|||||||
typescript: 5.7.3
|
typescript: 5.7.3
|
||||||
ufo: 1.5.4
|
ufo: 1.5.4
|
||||||
unbuild: 3.2.0
|
unbuild: 3.2.0
|
||||||
unhead: 1.11.15
|
unhead: 2.0.0-alpha.2
|
||||||
unimport: 3.14.5
|
unimport: 3.14.5
|
||||||
vite: 6.0.7
|
vite: 6.0.7
|
||||||
vue: 3.5.13
|
vue: 3.5.13
|
||||||
@ -72,11 +70,11 @@ importers:
|
|||||||
specifier: 7.5.8
|
specifier: 7.5.8
|
||||||
version: 7.5.8
|
version: 7.5.8
|
||||||
'@unhead/schema':
|
'@unhead/schema':
|
||||||
specifier: 1.11.15
|
specifier: 2.0.0-alpha.2
|
||||||
version: 1.11.15
|
version: 2.0.0-alpha.2
|
||||||
'@unhead/vue':
|
'@unhead/vue':
|
||||||
specifier: 1.11.15
|
specifier: 2.0.0-alpha.2
|
||||||
version: 1.11.15(vue@3.5.13(typescript@5.7.3))
|
version: 2.0.0-alpha.2(vue@3.5.13(typescript@5.7.3))
|
||||||
'@vitest/coverage-v8':
|
'@vitest/coverage-v8':
|
||||||
specifier: 2.1.8
|
specifier: 2.1.8
|
||||||
version: 2.1.8(vitest@2.1.8(@types/node@22.10.5)(happy-dom@16.5.3)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))
|
version: 2.1.8(vitest@2.1.8(@types/node@22.10.5)(happy-dom@16.5.3)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))
|
||||||
@ -303,18 +301,9 @@ importers:
|
|||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: 22.10.5
|
specifier: 22.10.5
|
||||||
version: 22.10.5
|
version: 22.10.5
|
||||||
'@unhead/dom':
|
|
||||||
specifier: 1.11.15
|
|
||||||
version: 1.11.15
|
|
||||||
'@unhead/shared':
|
|
||||||
specifier: 1.11.15
|
|
||||||
version: 1.11.15
|
|
||||||
'@unhead/ssr':
|
|
||||||
specifier: 1.11.15
|
|
||||||
version: 1.11.15
|
|
||||||
'@unhead/vue':
|
'@unhead/vue':
|
||||||
specifier: 1.11.15
|
specifier: 2.0.0-alpha.2
|
||||||
version: 1.11.15(vue@3.5.13(typescript@5.7.3))
|
version: 2.0.0-alpha.2(vue@3.5.13(typescript@5.7.3))
|
||||||
'@vue/shared':
|
'@vue/shared':
|
||||||
specifier: 3.5.13
|
specifier: 3.5.13
|
||||||
version: 3.5.13
|
version: 3.5.13
|
||||||
@ -444,9 +433,6 @@ importers:
|
|||||||
unenv:
|
unenv:
|
||||||
specifier: ^1.10.0
|
specifier: ^1.10.0
|
||||||
version: 1.10.0
|
version: 1.10.0
|
||||||
unhead:
|
|
||||||
specifier: 1.11.15
|
|
||||||
version: 1.11.15
|
|
||||||
unimport:
|
unimport:
|
||||||
specifier: 3.14.5
|
specifier: 3.14.5
|
||||||
version: 3.14.5(rollup@4.30.1)
|
version: 3.14.5(rollup@4.30.1)
|
||||||
@ -661,8 +647,8 @@ importers:
|
|||||||
specifier: 2.0.10
|
specifier: 2.0.10
|
||||||
version: 2.0.10
|
version: 2.0.10
|
||||||
'@unhead/schema':
|
'@unhead/schema':
|
||||||
specifier: 1.11.15
|
specifier: 2.0.0-alpha.2
|
||||||
version: 1.11.15
|
version: 2.0.0-alpha.2
|
||||||
'@vitejs/plugin-vue':
|
'@vitejs/plugin-vue':
|
||||||
specifier: 5.2.1
|
specifier: 5.2.1
|
||||||
version: 5.2.1(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))
|
version: 5.2.1(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))
|
||||||
@ -2743,20 +2729,14 @@ packages:
|
|||||||
'@ungap/structured-clone@1.2.0':
|
'@ungap/structured-clone@1.2.0':
|
||||||
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
|
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
|
||||||
|
|
||||||
'@unhead/dom@1.11.15':
|
'@unhead/schema@2.0.0-alpha.2':
|
||||||
resolution: {integrity: sha512-2OZ7zvZQLqlqkhvsKsNOhxxoO3vgjygzzrmtooQR9QNKY+3HjwJ3+QfjGswXI976YV7VJem57ydQSMk1ijB7yg==}
|
resolution: {integrity: sha512-Zuo0kqx2jnmxXDefsGEblTwSSXVenYDkMJ5H17lFTyxTIPnscISpvBSEFlPyCit7oTZXQ69wo4URhKiIXOZRyg==}
|
||||||
|
|
||||||
'@unhead/schema@1.11.15':
|
'@unhead/shared@2.0.0-alpha.2':
|
||||||
resolution: {integrity: sha512-UkLz1dqw4yoh4jELEyLsgSG7yrXc+gv68GkQeTv8LysEPa8sXtFqhfuqTBLhY3sHqSnP8RkDknhtFhG2S3fuKQ==}
|
resolution: {integrity: sha512-7hJpzfmnb9md6R3q5oxpX7bPdmTRbXsyaqHJzwaSrm9Q4+1J8wm0o36lwncQ0ssZfYxXynzrLkgY7sqCTSoGjA==}
|
||||||
|
|
||||||
'@unhead/shared@1.11.15':
|
'@unhead/vue@2.0.0-alpha.2':
|
||||||
resolution: {integrity: sha512-VT42ssmwpFGfixfXqAZ+Rn7KyNG0yFqWGsvLOXIgahiTzh3N1k2st1tPvuYFZU22dtWBNxG7cvy8yxUd1vunMQ==}
|
resolution: {integrity: sha512-ieMix+zVKp+8grIkokWHgeakS+GSK1NtDs40iC072XVYbtw+5qCKA0Vmkelp31NTH/XRbVHtIqlvbzNCWKT24w==}
|
||||||
|
|
||||||
'@unhead/ssr@1.11.15':
|
|
||||||
resolution: {integrity: sha512-btoJ7huldVdxOJOr9yx8DpDiUELzdlX3LB0k5cBub+CI4nZoPC/8ovuaYzKBriAIkEtQp9g9ytHRUJYDvim/1g==}
|
|
||||||
|
|
||||||
'@unhead/vue@1.11.15':
|
|
||||||
resolution: {integrity: sha512-2NT8Kph5AvB/qO+C8UKAc7cudbFRZTJk0eRpn8o1nG3yk2+mWvN0vsTTjnKvXixNF193I/R+zqo/NkcjgaWG9A==}
|
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vue: 3.5.13
|
vue: 3.5.13
|
||||||
|
|
||||||
@ -7242,8 +7222,8 @@ packages:
|
|||||||
unenv@1.10.0:
|
unenv@1.10.0:
|
||||||
resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==}
|
resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==}
|
||||||
|
|
||||||
unhead@1.11.15:
|
unhead@2.0.0-alpha.2:
|
||||||
resolution: {integrity: sha512-fA0rYB7qMHKY4sg0yzEXhi0cqiF/nl/OUKNaXOS9ChJwCjJxabpZvmQIUOiGS+1ckoFbZc3qZnhDLpdeNhOQwg==}
|
resolution: {integrity: sha512-niBkQIczWnFEJdE/3Zj4QlYtiHFCrLKVM/xdz9aOnZ3U+E8kWyCnEwpOLKZuOUjyXRGnvX9XMsbcBBkBe+ei+A==}
|
||||||
|
|
||||||
unicode-emoji-modifier-base@1.0.0:
|
unicode-emoji-modifier-base@1.0.0:
|
||||||
resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==}
|
resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==}
|
||||||
@ -8872,7 +8852,7 @@ snapshots:
|
|||||||
'@types/google.maps': 3.58.1
|
'@types/google.maps': 3.58.1
|
||||||
'@types/vimeo__player': 2.18.3
|
'@types/vimeo__player': 2.18.3
|
||||||
'@types/youtube': 0.1.0
|
'@types/youtube': 0.1.0
|
||||||
'@unhead/vue': 1.11.15(vue@3.5.13(typescript@5.7.3))
|
'@unhead/vue': 2.0.0-alpha.2(vue@3.5.13(typescript@5.7.3))
|
||||||
'@vueuse/core': 11.1.0(vue@3.5.13(typescript@5.7.3))
|
'@vueuse/core': 11.1.0(vue@3.5.13(typescript@5.7.3))
|
||||||
consola: 3.3.3
|
consola: 3.3.3
|
||||||
defu: 6.1.4
|
defu: 6.1.4
|
||||||
@ -9733,32 +9713,22 @@ snapshots:
|
|||||||
|
|
||||||
'@ungap/structured-clone@1.2.0': {}
|
'@ungap/structured-clone@1.2.0': {}
|
||||||
|
|
||||||
'@unhead/dom@1.11.15':
|
'@unhead/schema@2.0.0-alpha.2':
|
||||||
dependencies:
|
|
||||||
'@unhead/schema': 1.11.15
|
|
||||||
'@unhead/shared': 1.11.15
|
|
||||||
|
|
||||||
'@unhead/schema@1.11.15':
|
|
||||||
dependencies:
|
dependencies:
|
||||||
hookable: 5.5.3
|
hookable: 5.5.3
|
||||||
zhead: 2.2.4
|
zhead: 2.2.4
|
||||||
|
|
||||||
'@unhead/shared@1.11.15':
|
'@unhead/shared@2.0.0-alpha.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@unhead/schema': 1.11.15
|
'@unhead/schema': 2.0.0-alpha.2
|
||||||
packrup: 0.1.2
|
packrup: 0.1.2
|
||||||
|
|
||||||
'@unhead/ssr@1.11.15':
|
'@unhead/vue@2.0.0-alpha.2(vue@3.5.13(typescript@5.7.3))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@unhead/schema': 1.11.15
|
'@unhead/schema': 2.0.0-alpha.2
|
||||||
'@unhead/shared': 1.11.15
|
'@unhead/shared': 2.0.0-alpha.2
|
||||||
|
|
||||||
'@unhead/vue@1.11.15(vue@3.5.13(typescript@5.7.3))':
|
|
||||||
dependencies:
|
|
||||||
'@unhead/schema': 1.11.15
|
|
||||||
'@unhead/shared': 1.11.15
|
|
||||||
hookable: 5.5.3
|
hookable: 5.5.3
|
||||||
unhead: 1.11.15
|
unhead: 2.0.0-alpha.2
|
||||||
vue: 3.5.13(typescript@5.7.3)
|
vue: 3.5.13(typescript@5.7.3)
|
||||||
|
|
||||||
'@unocss/astro@0.62.4(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))':
|
'@unocss/astro@0.62.4(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))':
|
||||||
@ -15203,11 +15173,10 @@ snapshots:
|
|||||||
node-fetch-native: 1.6.4
|
node-fetch-native: 1.6.4
|
||||||
pathe: 1.1.2
|
pathe: 1.1.2
|
||||||
|
|
||||||
unhead@1.11.15:
|
unhead@2.0.0-alpha.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@unhead/dom': 1.11.15
|
'@unhead/schema': 2.0.0-alpha.2
|
||||||
'@unhead/schema': 1.11.15
|
'@unhead/shared': 2.0.0-alpha.2
|
||||||
'@unhead/shared': 1.11.15
|
|
||||||
hookable: 5.5.3
|
hookable: 5.5.3
|
||||||
|
|
||||||
unicode-emoji-modifier-base@1.0.0: {}
|
unicode-emoji-modifier-base@1.0.0: {}
|
||||||
|
@ -23,8 +23,8 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
const [clientStats, clientStatsInlined] = await Promise.all((['.output', '.output-inline'])
|
const [clientStats, clientStatsInlined] = await Promise.all((['.output', '.output-inline'])
|
||||||
.map(outputDir => analyzeSizes(['**/*.js'], join(rootDir, outputDir, 'public'))))
|
.map(outputDir => analyzeSizes(['**/*.js'], join(rootDir, outputDir, 'public'))))
|
||||||
|
|
||||||
expect.soft(roundToKilobytes(clientStats!.totalBytes)).toMatchInlineSnapshot(`"116k"`)
|
expect.soft(roundToKilobytes(clientStats!.totalBytes)).toMatchInlineSnapshot(`"115k"`)
|
||||||
expect.soft(roundToKilobytes(clientStatsInlined!.totalBytes)).toMatchInlineSnapshot(`"116k"`)
|
expect.soft(roundToKilobytes(clientStatsInlined!.totalBytes)).toMatchInlineSnapshot(`"115k"`)
|
||||||
|
|
||||||
const files = new Set([...clientStats!.files, ...clientStatsInlined!.files].map(f => f.replace(/\..*\.js/, '.js')))
|
const files = new Set([...clientStats!.files, ...clientStatsInlined!.files].map(f => f.replace(/\..*\.js/, '.js')))
|
||||||
|
|
||||||
@ -58,10 +58,10 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
const serverDir = join(rootDir, '.output/server')
|
const serverDir = join(rootDir, '.output/server')
|
||||||
|
|
||||||
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
||||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"210k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"209k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1398k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1382k"`)
|
||||||
|
|
||||||
const packages = modules.files
|
const packages = modules.files
|
||||||
.filter(m => m.endsWith('package.json'))
|
.filter(m => m.endsWith('package.json'))
|
||||||
@ -70,9 +70,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
expect(packages).toMatchInlineSnapshot(`
|
expect(packages).toMatchInlineSnapshot(`
|
||||||
[
|
[
|
||||||
"@babel/parser",
|
"@babel/parser",
|
||||||
"@unhead/dom",
|
|
||||||
"@unhead/shared",
|
"@unhead/shared",
|
||||||
"@unhead/ssr",
|
|
||||||
"@vue/compiler-core",
|
"@vue/compiler-core",
|
||||||
"@vue/compiler-dom",
|
"@vue/compiler-dom",
|
||||||
"@vue/compiler-ssr",
|
"@vue/compiler-ssr",
|
||||||
@ -103,7 +101,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"560k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"560k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"96.4k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"79.7k"`)
|
||||||
|
|
||||||
const packages = modules.files
|
const packages = modules.files
|
||||||
.filter(m => m.endsWith('package.json'))
|
.filter(m => m.endsWith('package.json'))
|
||||||
@ -111,9 +109,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
.sort()
|
.sort()
|
||||||
expect(packages).toMatchInlineSnapshot(`
|
expect(packages).toMatchInlineSnapshot(`
|
||||||
[
|
[
|
||||||
"@unhead/dom",
|
|
||||||
"@unhead/shared",
|
"@unhead/shared",
|
||||||
"@unhead/ssr",
|
|
||||||
"db0",
|
"db0",
|
||||||
"devalue",
|
"devalue",
|
||||||
"hookable",
|
"hookable",
|
||||||
@ -127,10 +123,10 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
const serverDir = join(pagesRootDir, '.output/server')
|
const serverDir = join(pagesRootDir, '.output/server')
|
||||||
|
|
||||||
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
||||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"303k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"302k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1398k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1382k"`)
|
||||||
|
|
||||||
const packages = modules.files
|
const packages = modules.files
|
||||||
.filter(m => m.endsWith('package.json'))
|
.filter(m => m.endsWith('package.json'))
|
||||||
@ -139,9 +135,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
expect(packages).toMatchInlineSnapshot(`
|
expect(packages).toMatchInlineSnapshot(`
|
||||||
[
|
[
|
||||||
"@babel/parser",
|
"@babel/parser",
|
||||||
"@unhead/dom",
|
|
||||||
"@unhead/shared",
|
"@unhead/shared",
|
||||||
"@unhead/ssr",
|
|
||||||
"@vue/compiler-core",
|
"@vue/compiler-core",
|
||||||
"@vue/compiler-dom",
|
"@vue/compiler-dom",
|
||||||
"@vue/compiler-ssr",
|
"@vue/compiler-ssr",
|
||||||
|
Loading…
Reference in New Issue
Block a user