mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-23 17:10:07 +00:00
chore: unhead 2.0.0-alpha.13
This commit is contained in:
parent
0f1e6b840a
commit
10ba2f1902
@ -260,8 +260,11 @@ for lower-level APIs.
|
|||||||
|
|
||||||
##### Migration Steps
|
##### Migration Steps
|
||||||
|
|
||||||
The above changes should have minimal impact on your app, at a minimal you should verify you're not using
|
The above changes should have minimal impact on your app.
|
||||||
any of the removed props.
|
|
||||||
|
If you have issues you should verify:
|
||||||
|
|
||||||
|
- You're not using any of the removed props.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
useHead({
|
useHead({
|
||||||
@ -274,6 +277,20 @@ useHead({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- If you're using [Template Params](https://unhead.unjs.io/usage/guides/template-params) or [Alias Tag Sorting](https://unhead.unjs.io/usage/guides/sorting#sort-with-before-and-after), you will need to explicitly opt in to these features now.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { TemplateParamsPlugin, AliasSortingPlugin } from '@unhead/vue/plugins'
|
||||||
|
|
||||||
|
export default defineNuxtPlugin({
|
||||||
|
setup() {
|
||||||
|
const unhead = injectHead()
|
||||||
|
unhead.use(TemplateParamsPlugin)
|
||||||
|
unhead.use(AliasSortingPlugin)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
While not required it's recommend to update any imports from `@unhead/vue` to `#imports` or `nuxt/app`.
|
While not required it's recommend to update any imports from `@unhead/vue` to `#imports` or `nuxt/app`.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
@ -281,7 +298,7 @@ While not required it's recommend to update any imports from `@unhead/vue` to `#
|
|||||||
+import { useHead } from '#imports'
|
+import { useHead } from '#imports'
|
||||||
```
|
```
|
||||||
|
|
||||||
If you do have issues you may revert the behavior by enabling the `head.legacy` config.
|
If you still have issues you may revert to the v1 behavior by enabling the `head.legacy` config.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
@ -120,7 +120,7 @@ interface MetaObject {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
See [@unhead/schema](https://github.com/unjs/unhead/blob/main/packages/schema/src/schema.ts) for more detailed types.
|
See [unhead/types](https://github.com/unjs/unhead/blob/main/packages/unhead/src/types/schema/head.ts) for more detailed types.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
@ -41,14 +41,15 @@ useHeadSafe(input: MaybeComputedRef<HeadSafe>): void
|
|||||||
The list of allowed values is:
|
The list of allowed values is:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
export default {
|
const WhitelistAttributes = {
|
||||||
htmlAttrs: ['id', 'class', 'lang', 'dir'],
|
htmlAttrs: ['class', 'style', 'lang', 'dir'],
|
||||||
bodyAttrs: ['id', 'class'],
|
bodyAttrs: ['class', 'style'],
|
||||||
meta: ['id', 'name', 'property', 'charset', 'content'],
|
meta: ['name', 'property', 'charset', 'content', 'media'],
|
||||||
noscript: ['id', 'textContent'],
|
noscript: ['textContent'],
|
||||||
script: ['id', 'type', 'textContent'],
|
style: ['media', 'textContent', 'nonce', 'title', 'blocking'],
|
||||||
link: ['id', 'color', 'crossorigin', 'fetchpriority', 'href', 'hreflang', 'imagesrcset', 'imagesizes', 'integrity', 'media', 'referrerpolicy', 'rel', 'sizes', 'type'],
|
script: ['type', 'textContent', 'nonce', 'blocking'],
|
||||||
|
link: ['color', 'crossorigin', 'fetchpriority', 'href', 'hreflang', 'imagesrcset', 'imagesizes', 'integrity', 'media', 'referrerpolicy', 'rel', 'sizes', 'type'],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
See [@unhead/schema](https://github.com/unjs/unhead/blob/main/packages/schema/src/safeSchema.ts) for more detailed types.
|
See [SafeInputPlugin](https://github.com/unjs/unhead/blob/main/packages/unhead/src/plugins/safe.ts) for more detailed types.
|
||||||
|
@ -35,7 +35,7 @@ interface MetaObject {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
See [@unhead/schema](https://github.com/unjs/unhead/blob/main/packages/schema/src/schema.ts) for more detailed types.
|
See [unhead/types](https://github.com/unjs/unhead/blob/main/packages/unhead/src/types/schema/head.ts) for more detailed types.
|
||||||
|
|
||||||
::note
|
::note
|
||||||
The properties of `useHead` can be dynamic, accepting `ref`, `computed` and `reactive` properties. `meta` parameter can also accept a function returning an object to make the entire object reactive.
|
The properties of `useHead` can be dynamic, accepting `ref`, `computed` and `reactive` properties. `meta` parameter can also accept a function returning an object to make the entire object reactive.
|
||||||
|
@ -46,9 +46,7 @@
|
|||||||
"@nuxt/vite-builder": "workspace:*",
|
"@nuxt/vite-builder": "workspace:*",
|
||||||
"@nuxt/webpack-builder": "workspace:*",
|
"@nuxt/webpack-builder": "workspace:*",
|
||||||
"@types/node": "22.13.1",
|
"@types/node": "22.13.1",
|
||||||
"@unhead/schema": "2.0.0-alpha.9",
|
"@unhead/vue": "2.0.0-alpha.13",
|
||||||
"@unhead/shared": "2.0.0-alpha.9",
|
|
||||||
"@unhead/vue": "2.0.0-alpha.8",
|
|
||||||
"@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",
|
||||||
@ -65,7 +63,6 @@
|
|||||||
"typescript": "5.7.3",
|
"typescript": "5.7.3",
|
||||||
"ufo": "1.5.4",
|
"ufo": "1.5.4",
|
||||||
"unbuild": "3.3.1",
|
"unbuild": "3.3.1",
|
||||||
"unhead": "2.0.0-alpha.9",
|
|
||||||
"unimport": "4.1.1",
|
"unimport": "4.1.1",
|
||||||
"vite": "6.1.0",
|
"vite": "6.1.0",
|
||||||
"vue": "3.5.13"
|
"vue": "3.5.13"
|
||||||
@ -86,8 +83,7 @@
|
|||||||
"@types/babel__helper-plugin-utils": "7.10.3",
|
"@types/babel__helper-plugin-utils": "7.10.3",
|
||||||
"@types/node": "22.13.1",
|
"@types/node": "22.13.1",
|
||||||
"@types/semver": "7.5.8",
|
"@types/semver": "7.5.8",
|
||||||
"@unhead/schema": "2.0.0-alpha.9",
|
"@unhead/vue": "2.0.0-alpha.13",
|
||||||
"@unhead/vue": "2.0.0-alpha.9",
|
|
||||||
"@vitest/coverage-v8": "3.0.5",
|
"@vitest/coverage-v8": "3.0.5",
|
||||||
"@vue/test-utils": "2.4.6",
|
"@vue/test-utils": "2.4.6",
|
||||||
"acorn": "8.14.0",
|
"acorn": "8.14.0",
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
"@nuxt/schema": "workspace:*",
|
"@nuxt/schema": "workspace:*",
|
||||||
"@nuxt/telemetry": "^2.6.5",
|
"@nuxt/telemetry": "^2.6.5",
|
||||||
"@nuxt/vite-builder": "workspace:*",
|
"@nuxt/vite-builder": "workspace:*",
|
||||||
"@unhead/vue": "^2.0.0-alpha.9",
|
"@unhead/vue": "^2.0.0-alpha.13",
|
||||||
"@vue/shared": "^3.5.13",
|
"@vue/shared": "^3.5.13",
|
||||||
"acorn": "8.14.0",
|
"acorn": "8.14.0",
|
||||||
"c12": "^2.0.2",
|
"c12": "^2.0.2",
|
||||||
|
@ -18,7 +18,6 @@ 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 { createHead as createServerHead, propsToString, renderSSRHead } from '@unhead/vue/server'
|
import { createHead as createServerHead, propsToString, renderSSRHead } from '@unhead/vue/server'
|
||||||
import type { Head, HeadEntryOptions, Link, Script, Style } from '@unhead/vue/types'
|
import type { Head, HeadEntryOptions, Link, Script, Style } from '@unhead/vue/types'
|
||||||
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'
|
||||||
@ -468,19 +467,19 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
|
|||||||
}, headEntryOptions)
|
}, headEntryOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove certain tags for nuxt islands
|
const tags = await head.resolveTags()
|
||||||
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head, renderSSRHeadOptions)
|
|
||||||
|
|
||||||
// Response for component islands
|
// Response for component islands
|
||||||
if (isRenderingIsland && islandContext) {
|
if (isRenderingIsland && islandContext) {
|
||||||
const islandHead: Head = {}
|
const islandHead: Head = {}
|
||||||
for (const entry of head.headEntries()) {
|
for (const tag of tags) {
|
||||||
for (const [key, value] of Object.entries(resolveUnrefHeadInput(entry.input) as Head)) {
|
const currentValue = islandHead[tag.tag as keyof Head]
|
||||||
const currentValue = islandHead[key as keyof Head]
|
if (['meta', 'link', 'style', 'script', 'noscript'].includes(tag.tag)) {
|
||||||
if (Array.isArray(currentValue)) {
|
const value = currentValue || []
|
||||||
currentValue.push(...value)
|
value.push(tag.props)
|
||||||
}
|
islandHead[tag.tag as keyof Head] = value
|
||||||
islandHead[key as keyof Head] = value
|
} else {
|
||||||
|
islandHead[tag.tag as keyof Head] = tag.props
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -514,6 +513,12 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
|
|||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove certain tags for nuxt islands
|
||||||
|
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head, {
|
||||||
|
...renderSSRHeadOptions,
|
||||||
|
resolvedTags: tags,
|
||||||
|
})
|
||||||
|
|
||||||
// Create render context
|
// Create render context
|
||||||
const htmlContext: NuxtRenderHTMLContext = {
|
const htmlContext: NuxtRenderHTMLContext = {
|
||||||
island: isRenderingIsland,
|
island: isRenderingIsland,
|
||||||
|
@ -45,7 +45,7 @@ export default defineNuxtModule<NuxtOptions['unhead']>({
|
|||||||
rootDir: nuxt.options.rootDir,
|
rootDir: nuxt.options.rootDir,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const unheadPlugins = await tryResolveModule('unhead/plugins', nuxt.options.modulesDir) || 'unhead/plugins'
|
const unheadPlugins = await tryResolveModule('@unhead/vue/plugins', nuxt.options.modulesDir) || '@unhead/vue/plugins'
|
||||||
addTemplate({
|
addTemplate({
|
||||||
filename: 'unhead-options.mjs',
|
filename: 'unhead-options.mjs',
|
||||||
getContents () {
|
getContents () {
|
||||||
@ -54,10 +54,10 @@ export default defineNuxtModule<NuxtOptions['unhead']>({
|
|||||||
}
|
}
|
||||||
// v1 unhead legacy options
|
// v1 unhead legacy options
|
||||||
const disableCapoSorting = !nuxt.options.experimental.headNext
|
const disableCapoSorting = !nuxt.options.experimental.headNext
|
||||||
return `import { DeprecationsPlugin, PromisesPlugin } from ${JSON.stringify(unheadPlugins)};
|
return `import { DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin } from ${JSON.stringify(unheadPlugins)};
|
||||||
export default {
|
export default {
|
||||||
disableCapoSorting: ${Boolean(disableCapoSorting)},
|
disableCapoSorting: ${Boolean(disableCapoSorting)},
|
||||||
plugins: [DeprecationsPlugin, PromisesPlugin],
|
plugins: [DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin],
|
||||||
}`
|
}`
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -36,7 +36,7 @@ export const UnheadImportsPlugin = (options: UnheadImportsPluginOptions) => crea
|
|||||||
name: 'nuxt:head:unhead-imports',
|
name: 'nuxt:head:unhead-imports',
|
||||||
enforce: 'post',
|
enforce: 'post',
|
||||||
transformInclude (id) {
|
transformInclude (id) {
|
||||||
return (isJS(id) || isVue(id, { type: ['script'] })) && !id.startsWith(distDir) && !UNHEAD_LIB_RE.test(id)
|
return (isJS(id) || isVue(id, { type: ['script'] })) && !id.startsWith('virtual:') && !id.startsWith(distDir) && !UNHEAD_LIB_RE.test(id)
|
||||||
},
|
},
|
||||||
transform (code, id) {
|
transform (code, id) {
|
||||||
if (!code.includes(UnheadVue)) {
|
if (!code.includes(UnheadVue)) {
|
||||||
@ -66,6 +66,7 @@ export const UnheadImportsPlugin = (options: UnheadImportsPluginOptions) => crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s.hasChanged()) {
|
if (s.hasChanged()) {
|
||||||
|
console.log('transformed', id)
|
||||||
return {
|
return {
|
||||||
code: s.toString(),
|
code: s.toString(),
|
||||||
map: options.sourcemap
|
map: options.sourcemap
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue'
|
import type { ActiveHeadEntry, MergeHead, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue'
|
||||||
import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
|
|
||||||
import { hasInjectionContext, inject } from 'vue'
|
import { hasInjectionContext, inject } from 'vue'
|
||||||
import {
|
import {
|
||||||
useHead as headCore,
|
useHead as headCore,
|
||||||
@ -8,8 +7,8 @@ import {
|
|||||||
useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe,
|
useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe,
|
||||||
useServerSeoMeta as serverSeoMeta,
|
useServerSeoMeta as serverSeoMeta,
|
||||||
} from '@unhead/vue'
|
} from '@unhead/vue'
|
||||||
import { tryUseNuxtApp } from '#app'
|
import { tryUseNuxtApp } from '#app/nuxt'
|
||||||
import type { NuxtApp } from '#app'
|
import type { NuxtApp } from '#app/nuxt'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects the head client from the Nuxt context or Vue inject.
|
* Injects the head client from the Nuxt context or Vue inject.
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue'
|
import type { ActiveHeadEntry, MergeHead, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue/types'
|
||||||
import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
|
|
||||||
import { hasInjectionContext, inject } from 'vue'
|
import { hasInjectionContext, inject } from 'vue'
|
||||||
import {
|
import {
|
||||||
useHead as headCore,
|
useHead as headCore,
|
||||||
@ -8,8 +7,8 @@ import {
|
|||||||
useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe,
|
useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe,
|
||||||
useServerSeoMeta as serverSeoMeta,
|
useServerSeoMeta as serverSeoMeta,
|
||||||
} from '@unhead/vue'
|
} from '@unhead/vue'
|
||||||
import { useNuxtApp } from '#app'
|
import { useNuxtApp } from '#app/nuxt'
|
||||||
import type { NuxtApp } from '#app'
|
import type { NuxtApp } from '#app/nuxt'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects the head client from the Nuxt context or Vue inject.
|
* Injects the head client from the Nuxt context or Vue inject.
|
||||||
|
@ -28,7 +28,7 @@ export default defineBuildConfig({
|
|||||||
},
|
},
|
||||||
externals: [
|
externals: [
|
||||||
// Type imports
|
// Type imports
|
||||||
'@unhead/schema',
|
'@unhead/vue',
|
||||||
'@vitejs/plugin-vue',
|
'@vitejs/plugin-vue',
|
||||||
'chokidar',
|
'chokidar',
|
||||||
'@vitejs/plugin-vue-jsx',
|
'@vitejs/plugin-vue-jsx',
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
"@types/rollup-plugin-visualizer": "4.2.4",
|
"@types/rollup-plugin-visualizer": "4.2.4",
|
||||||
"@types/webpack-bundle-analyzer": "4.7.0",
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
||||||
"@types/webpack-hot-middleware": "2.25.9",
|
"@types/webpack-hot-middleware": "2.25.9",
|
||||||
"@unhead/schema": "2.0.0-alpha.9",
|
|
||||||
"@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",
|
||||||
|
@ -260,7 +260,7 @@ export default defineResolvers({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Customize Nuxt root element id.
|
* Customize Nuxt root element id.
|
||||||
* @type {typeof import('@unhead/schema').HtmlAttributes}
|
* @type {typeof import('@unhead/vue/types').ResolvedHtmlAttributes}
|
||||||
*/
|
*/
|
||||||
rootAttrs: {
|
rootAttrs: {
|
||||||
$resolve: async (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
@ -290,7 +290,7 @@ export default defineResolvers({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Customize Nuxt Teleport element attributes.
|
* Customize Nuxt Teleport element attributes.
|
||||||
* @type {typeof import('@unhead/schema').HtmlAttributes}
|
* @type {typeof import('@unhead/vue/types').ResolvedHtmlAttributes}
|
||||||
*/
|
*/
|
||||||
teleportAttrs: {
|
teleportAttrs: {
|
||||||
$resolve: async (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
@ -311,7 +311,7 @@ export default defineResolvers({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Customize Nuxt Nuxt SpaLoader element attributes.
|
* Customize Nuxt Nuxt SpaLoader element attributes.
|
||||||
* @type {Partial<typeof import('@unhead/schema').HtmlAttributes>}
|
* @type {Partial<typeof import('@unhead/vue/types').ResolvedHtmlAttributes>}
|
||||||
*/
|
*/
|
||||||
spaLoaderAttrs: {
|
spaLoaderAttrs: {
|
||||||
id: '__nuxt-loader',
|
id: '__nuxt-loader',
|
||||||
@ -486,7 +486,7 @@ export default defineResolvers({
|
|||||||
* }
|
* }
|
||||||
* })
|
* })
|
||||||
* ```
|
* ```
|
||||||
* @type {typeof import('@unhead/schema').RenderSSRHeadOptions}
|
* @type {typeof import('@unhead/vue/types').RenderSSRHeadOptions}
|
||||||
*/
|
*/
|
||||||
renderSSRHeadOptions: {
|
renderSSRHeadOptions: {
|
||||||
$resolve: async (val, get) => {
|
$resolve: async (val, get) => {
|
||||||
|
@ -4,7 +4,7 @@ export type { Component, ComponentMeta, ComponentsDir, ComponentsOptions, ScanDi
|
|||||||
export type { AppConfig, AppConfigInput, CustomAppConfig, NuxtAppConfig, NuxtBuilder, NuxtConfig, NuxtConfigLayer, NuxtOptions, PublicRuntimeConfig, RuntimeConfig, RuntimeValue, SchemaDefinition, UpperSnakeCase, ViteConfig } from './types/config'
|
export type { AppConfig, AppConfigInput, CustomAppConfig, NuxtAppConfig, NuxtBuilder, NuxtConfig, NuxtConfigLayer, NuxtOptions, PublicRuntimeConfig, RuntimeConfig, RuntimeValue, SchemaDefinition, UpperSnakeCase, ViteConfig } from './types/config'
|
||||||
export type { GenerateAppOptions, HookResult, ImportPresetWithDeprecation, NuxtAnalyzeMeta, NuxtHookName, NuxtHooks, NuxtLayout, NuxtMiddleware, NuxtPage, TSReference, VueTSConfig, WatchEvent } from './types/hooks'
|
export type { GenerateAppOptions, HookResult, ImportPresetWithDeprecation, NuxtAnalyzeMeta, NuxtHookName, NuxtHooks, NuxtLayout, NuxtMiddleware, NuxtPage, TSReference, VueTSConfig, WatchEvent } from './types/hooks'
|
||||||
export type { ImportsOptions } from './types/imports'
|
export type { ImportsOptions } from './types/imports'
|
||||||
export type { AppHeadMetaObject, MetaObject, MetaObjectRaw, HeadAugmentations } from './types/head'
|
export type { AppHeadMetaObject, MetaObject, MetaObjectRaw } from './types/head'
|
||||||
export type { ModuleDefinition, ModuleMeta, ModuleOptions, ModuleSetupInstallResult, ModuleSetupReturn, NuxtModule, ResolvedModuleOptions } from './types/module'
|
export type { ModuleDefinition, ModuleMeta, ModuleOptions, ModuleSetupInstallResult, ModuleSetupReturn, NuxtModule, ResolvedModuleOptions } from './types/module'
|
||||||
export type { Nuxt, NuxtApp, NuxtPlugin, NuxtPluginTemplate, NuxtTemplate, NuxtTypeTemplate, NuxtServerTemplate, ResolvedNuxtTemplate } from './types/nuxt'
|
export type { Nuxt, NuxtApp, NuxtPlugin, NuxtPluginTemplate, NuxtTemplate, NuxtTypeTemplate, NuxtServerTemplate, ResolvedNuxtTemplate } from './types/nuxt'
|
||||||
export type { RouterConfig, RouterConfigSerializable, RouterOptions } from './types/router'
|
export type { RouterConfig, RouterConfigSerializable, RouterOptions } from './types/router'
|
||||||
|
@ -1,27 +1,6 @@
|
|||||||
import type { Head, MergeHead } from '@unhead/schema'
|
import type { Head, MergeHead } from '@unhead/vue/types'
|
||||||
|
|
||||||
/** @deprecated Extend types from `@unhead/schema` directly. This may be removed in a future minor version. */
|
export type MetaObjectRaw = Head<MergeHead>
|
||||||
export interface HeadAugmentations extends MergeHead {
|
|
||||||
// runtime type modifications
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
base?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
link?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
meta?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
style?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
script?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
noscript?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
htmlAttrs?: {}
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
||||||
bodyAttrs?: {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MetaObjectRaw = Head<HeadAugmentations>
|
|
||||||
export type MetaObject = MetaObjectRaw
|
export type MetaObject = MetaObjectRaw
|
||||||
|
|
||||||
export type AppHeadMetaObject = MetaObjectRaw & {
|
export type AppHeadMetaObject = MetaObjectRaw & {
|
||||||
|
@ -14,9 +14,7 @@ overrides:
|
|||||||
'@nuxt/vite-builder': workspace:*
|
'@nuxt/vite-builder': workspace:*
|
||||||
'@nuxt/webpack-builder': workspace:*
|
'@nuxt/webpack-builder': workspace:*
|
||||||
'@types/node': 22.13.1
|
'@types/node': 22.13.1
|
||||||
'@unhead/schema': 2.0.0-alpha.9
|
'@unhead/vue': 2.0.0-alpha.13
|
||||||
'@unhead/shared': 2.0.0-alpha.9
|
|
||||||
'@unhead/vue': 2.0.0-alpha.8
|
|
||||||
'@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
|
||||||
@ -33,7 +31,6 @@ overrides:
|
|||||||
typescript: 5.7.3
|
typescript: 5.7.3
|
||||||
ufo: 1.5.4
|
ufo: 1.5.4
|
||||||
unbuild: 3.3.1
|
unbuild: 3.3.1
|
||||||
unhead: 2.0.0-alpha.9
|
|
||||||
unimport: 4.1.1
|
unimport: 4.1.1
|
||||||
vite: 6.1.0
|
vite: 6.1.0
|
||||||
vue: 3.5.13
|
vue: 3.5.13
|
||||||
@ -87,12 +84,9 @@ importers:
|
|||||||
'@types/semver':
|
'@types/semver':
|
||||||
specifier: 7.5.8
|
specifier: 7.5.8
|
||||||
version: 7.5.8
|
version: 7.5.8
|
||||||
'@unhead/schema':
|
|
||||||
specifier: 2.0.0-alpha.9
|
|
||||||
version: 2.0.0-alpha.9
|
|
||||||
'@unhead/vue':
|
'@unhead/vue':
|
||||||
specifier: 2.0.0-alpha.8
|
specifier: 2.0.0-alpha.13
|
||||||
version: 2.0.0-alpha.8(vue@3.5.13(typescript@5.7.3))
|
version: 2.0.0-alpha.13(vue@3.5.13(typescript@5.7.3))
|
||||||
'@vitest/coverage-v8':
|
'@vitest/coverage-v8':
|
||||||
specifier: 3.0.5
|
specifier: 3.0.5
|
||||||
version: 3.0.5(vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.1)(happy-dom@17.0.4)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.7.0))
|
version: 3.0.5(vitest@3.0.5(@types/debug@4.1.12)(@types/node@22.13.1)(happy-dom@17.0.4)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.7.0))
|
||||||
@ -344,8 +338,8 @@ importers:
|
|||||||
specifier: 22.13.1
|
specifier: 22.13.1
|
||||||
version: 22.13.1
|
version: 22.13.1
|
||||||
'@unhead/vue':
|
'@unhead/vue':
|
||||||
specifier: 2.0.0-alpha.8
|
specifier: 2.0.0-alpha.13
|
||||||
version: 2.0.0-alpha.8(vue@3.5.13(typescript@5.7.3))
|
version: 2.0.0-alpha.13(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
|
||||||
@ -508,7 +502,7 @@ importers:
|
|||||||
devDependencies:
|
devDependencies:
|
||||||
'@nuxt/scripts':
|
'@nuxt/scripts':
|
||||||
specifier: 0.10.1
|
specifier: 0.10.1
|
||||||
version: 0.10.1(@types/google.maps@3.58.1)(@types/vimeo__player@2.18.3)(@types/youtube@0.1.0)(@unhead/vue@2.0.0-alpha.8(vue@3.5.13(typescript@5.7.3)))(typescript@5.7.3)
|
version: 0.10.1(@types/google.maps@3.58.1)(@types/vimeo__player@2.18.3)(@types/youtube@0.1.0)(@unhead/vue@2.0.0-alpha.13(vue@3.5.13(typescript@5.7.3)))(typescript@5.7.3)
|
||||||
'@parcel/watcher':
|
'@parcel/watcher':
|
||||||
specifier: 2.5.1
|
specifier: 2.5.1
|
||||||
version: 2.5.1
|
version: 2.5.1
|
||||||
@ -700,9 +694,6 @@ importers:
|
|||||||
'@types/webpack-hot-middleware':
|
'@types/webpack-hot-middleware':
|
||||||
specifier: 2.25.9
|
specifier: 2.25.9
|
||||||
version: 2.25.9(esbuild@0.25.0)
|
version: 2.25.9(esbuild@0.25.0)
|
||||||
'@unhead/schema':
|
|
||||||
specifier: 2.0.0-alpha.9
|
|
||||||
version: 2.0.0-alpha.9
|
|
||||||
'@vitejs/plugin-vue':
|
'@vitejs/plugin-vue':
|
||||||
specifier: 5.2.1
|
specifier: 5.2.1
|
||||||
version: 5.2.1(vite@6.1.0(@types/node@22.13.1)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.7.0))(vue@3.5.13(typescript@5.7.3))
|
version: 5.2.1(vite@6.1.0(@types/node@22.13.1)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.7.0))(vue@3.5.13(typescript@5.7.3))
|
||||||
@ -2127,7 +2118,7 @@ packages:
|
|||||||
'@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': 2.0.0-alpha.8
|
'@unhead/vue': 2.0.0-alpha.13
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
'@stripe/stripe-js':
|
'@stripe/stripe-js':
|
||||||
optional: true
|
optional: true
|
||||||
@ -2903,14 +2894,8 @@ 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/schema@2.0.0-alpha.9':
|
'@unhead/vue@2.0.0-alpha.13':
|
||||||
resolution: {integrity: sha512-KNMPY8tpeJ0FvHlA+81q2QeFZJ7vMMg9TBBdQBudLsza1whSSHvmpxVJY8rw8GNpnXrvnRYspLNHKpDn69RJrA==}
|
resolution: {integrity: sha512-rp1eKnXeXdrmt39JQRlQXJTYKuJOiyJ+kqqp06PifhtNv3jk0/5eXMJBeG01Rj2mOHa7/ABforoIdIxQotIzDA==}
|
||||||
|
|
||||||
'@unhead/shared@2.0.0-alpha.9':
|
|
||||||
resolution: {integrity: sha512-Ex/BsuAVix8X8pLEQ4gxrEmTzN10WoCh0hs6OHXQqjkvoDCzJo2OdIoQoR1B245PSzVagZhJ+PJCfXtkm8BEVQ==}
|
|
||||||
|
|
||||||
'@unhead/vue@2.0.0-alpha.8':
|
|
||||||
resolution: {integrity: sha512-pBh1QgDMPyx5xwOykMFOCV4+S9X2hIRZbfk3K0shyb61vPuMJVcy4aEYbQyMCy/LAbH1PyAUug5dW97QF758tw==}
|
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vue: 3.5.13
|
vue: 3.5.13
|
||||||
|
|
||||||
@ -5959,9 +5944,6 @@ packages:
|
|||||||
package-manager-detector@0.2.9:
|
package-manager-detector@0.2.9:
|
||||||
resolution: {integrity: sha512-+vYvA/Y31l8Zk8dwxHhL3JfTuHPm6tlxM2A3GeQyl7ovYnSp1+mzAxClxaOr0qO1TtPxbQxetI7v5XqKLJZk7Q==}
|
resolution: {integrity: sha512-+vYvA/Y31l8Zk8dwxHhL3JfTuHPm6tlxM2A3GeQyl7ovYnSp1+mzAxClxaOr0qO1TtPxbQxetI7v5XqKLJZk7Q==}
|
||||||
|
|
||||||
packrup@0.1.2:
|
|
||||||
resolution: {integrity: sha512-ZcKU7zrr5GlonoS9cxxrb5HVswGnyj6jQvwFBa6p5VFw7G71VAHcUKL5wyZSU/ECtPM/9gacWxy2KFQKt1gMNA==}
|
|
||||||
|
|
||||||
parent-module@1.0.1:
|
parent-module@1.0.1:
|
||||||
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
|
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -7284,8 +7266,8 @@ packages:
|
|||||||
unenv@1.10.0:
|
unenv@1.10.0:
|
||||||
resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==}
|
resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==}
|
||||||
|
|
||||||
unhead@2.0.0-alpha.9:
|
unhead@2.0.0-alpha.13:
|
||||||
resolution: {integrity: sha512-Pvf5SZqAMOwumnCgOVOJtuJm4IM+QBOw1tCzvINFp31KNnBqQ6UCk3bYPWWdqjxavwFK3/lKs017qWS6PNKQqQ==}
|
resolution: {integrity: sha512-fekwwUZtWKNwGY+VXKtugsBAcQN5X4Rc/ctXjVu8OZ8w6KCu+ST7eOC7ac1HVK8vN7fb0SKaSqWCNlw3NZFzRA==}
|
||||||
|
|
||||||
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==}
|
||||||
@ -7918,9 +7900,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}
|
resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
zhead@2.2.4:
|
|
||||||
resolution: {integrity: sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag==}
|
|
||||||
|
|
||||||
zip-stream@6.0.1:
|
zip-stream@6.0.1:
|
||||||
resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==}
|
resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==}
|
||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
@ -8840,10 +8819,10 @@ snapshots:
|
|||||||
string-width: 4.2.3
|
string-width: 4.2.3
|
||||||
webpack: 5.97.1
|
webpack: 5.97.1
|
||||||
|
|
||||||
'@nuxt/scripts@0.10.1(@types/google.maps@3.58.1)(@types/vimeo__player@2.18.3)(@types/youtube@0.1.0)(@unhead/vue@2.0.0-alpha.8(vue@3.5.13(typescript@5.7.3)))(typescript@5.7.3)':
|
'@nuxt/scripts@0.10.1(@types/google.maps@3.58.1)(@types/vimeo__player@2.18.3)(@types/youtube@0.1.0)(@unhead/vue@2.0.0-alpha.13(vue@3.5.13(typescript@5.7.3)))(typescript@5.7.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nuxt/kit': link:packages/kit
|
'@nuxt/kit': link:packages/kit
|
||||||
'@unhead/vue': 2.0.0-alpha.8(vue@3.5.13(typescript@5.7.3))
|
'@unhead/vue': 2.0.0-alpha.13(vue@3.5.13(typescript@5.7.3))
|
||||||
'@vueuse/core': 12.5.0(typescript@5.7.3)
|
'@vueuse/core': 12.5.0(typescript@5.7.3)
|
||||||
consola: 3.4.0
|
consola: 3.4.0
|
||||||
defu: 6.1.4
|
defu: 6.1.4
|
||||||
@ -9788,22 +9767,10 @@ snapshots:
|
|||||||
|
|
||||||
'@ungap/structured-clone@1.2.0': {}
|
'@ungap/structured-clone@1.2.0': {}
|
||||||
|
|
||||||
'@unhead/schema@2.0.0-alpha.9':
|
'@unhead/vue@2.0.0-alpha.13(vue@3.5.13(typescript@5.7.3))':
|
||||||
dependencies:
|
dependencies:
|
||||||
hookable: 5.5.3
|
hookable: 5.5.3
|
||||||
zhead: 2.2.4
|
unhead: 2.0.0-alpha.13
|
||||||
|
|
||||||
'@unhead/shared@2.0.0-alpha.9':
|
|
||||||
dependencies:
|
|
||||||
'@unhead/schema': 2.0.0-alpha.9
|
|
||||||
packrup: 0.1.2
|
|
||||||
|
|
||||||
'@unhead/vue@2.0.0-alpha.8(vue@3.5.13(typescript@5.7.3))':
|
|
||||||
dependencies:
|
|
||||||
'@unhead/schema': 2.0.0-alpha.9
|
|
||||||
'@unhead/shared': 2.0.0-alpha.9
|
|
||||||
hookable: 5.5.3
|
|
||||||
unhead: 2.0.0-alpha.9
|
|
||||||
vue: 3.5.13(typescript@5.7.3)
|
vue: 3.5.13(typescript@5.7.3)
|
||||||
|
|
||||||
'@unocss/astro@65.4.3(rollup@4.34.6)(vite@6.1.0(@types/node@22.13.1)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.7.0))(vue@3.5.13(typescript@5.7.3))':
|
'@unocss/astro@65.4.3(rollup@4.34.6)(vite@6.1.0(@types/node@22.13.1)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.7.0))(vue@3.5.13(typescript@5.7.3))':
|
||||||
@ -13581,8 +13548,6 @@ snapshots:
|
|||||||
|
|
||||||
package-manager-detector@0.2.9: {}
|
package-manager-detector@0.2.9: {}
|
||||||
|
|
||||||
packrup@0.1.2: {}
|
|
||||||
|
|
||||||
parent-module@1.0.1:
|
parent-module@1.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
callsites: 3.1.0
|
callsites: 3.1.0
|
||||||
@ -15040,10 +15005,8 @@ snapshots:
|
|||||||
node-fetch-native: 1.6.6
|
node-fetch-native: 1.6.6
|
||||||
pathe: 1.1.2
|
pathe: 1.1.2
|
||||||
|
|
||||||
unhead@2.0.0-alpha.9:
|
unhead@2.0.0-alpha.13:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@unhead/schema': 2.0.0-alpha.9
|
|
||||||
'@unhead/shared': 2.0.0-alpha.9
|
|
||||||
hookable: 5.5.3
|
hookable: 5.5.3
|
||||||
|
|
||||||
unicode-emoji-modifier-base@1.0.0: {}
|
unicode-emoji-modifier-base@1.0.0: {}
|
||||||
@ -15800,8 +15763,6 @@ snapshots:
|
|||||||
|
|
||||||
yoctocolors@2.1.1: {}
|
yoctocolors@2.1.1: {}
|
||||||
|
|
||||||
zhead@2.2.4: {}
|
|
||||||
|
|
||||||
zip-stream@6.0.1:
|
zip-stream@6.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
archiver-utils: 5.0.2
|
archiver-utils: 5.0.2
|
||||||
|
@ -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(`"114k"`)
|
expect.soft(roundToKilobytes(clientStats!.totalBytes)).toMatchInlineSnapshot(`"111k"`)
|
||||||
expect.soft(roundToKilobytes(clientStatsInlined!.totalBytes)).toMatchInlineSnapshot(`"114k"`)
|
expect.soft(roundToKilobytes(clientStatsInlined!.totalBytes)).toMatchInlineSnapshot(`"111k"`)
|
||||||
|
|
||||||
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')))
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
it('default client bundle size (pages)', async () => {
|
it('default client bundle size (pages)', async () => {
|
||||||
const clientStats = await analyzeSizes(['**/*.js'], join(pagesRootDir, '.output/public'))
|
const clientStats = await analyzeSizes(['**/*.js'], join(pagesRootDir, '.output/public'))
|
||||||
|
|
||||||
expect.soft(roundToKilobytes(clientStats!.totalBytes)).toMatchInlineSnapshot(`"175k"`)
|
expect.soft(roundToKilobytes(clientStats!.totalBytes)).toMatchInlineSnapshot(`"172k"`)
|
||||||
|
|
||||||
const files = clientStats!.files.map(f => f.replace(/\..*\.js/, '.js'))
|
const files = clientStats!.files.map(f => f.replace(/\..*\.js/, '.js'))
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ 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(`"208k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"0.0k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1388k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1388k"`)
|
||||||
@ -70,7 +70,6 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
expect(packages).toMatchInlineSnapshot(`
|
expect(packages).toMatchInlineSnapshot(`
|
||||||
[
|
[
|
||||||
"@babel/parser",
|
"@babel/parser",
|
||||||
"@unhead/shared",
|
|
||||||
"@vue/compiler-core",
|
"@vue/compiler-core",
|
||||||
"@vue/compiler-dom",
|
"@vue/compiler-dom",
|
||||||
"@vue/compiler-ssr",
|
"@vue/compiler-ssr",
|
||||||
@ -84,7 +83,6 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
"entities",
|
"entities",
|
||||||
"estree-walker",
|
"estree-walker",
|
||||||
"hookable",
|
"hookable",
|
||||||
"packrup",
|
|
||||||
"source-map-js",
|
"source-map-js",
|
||||||
"ufo",
|
"ufo",
|
||||||
"unhead",
|
"unhead",
|
||||||
@ -98,10 +96,10 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
const serverDir = join(rootDir, '.output-inline/server')
|
const serverDir = join(rootDir, '.output-inline/server')
|
||||||
|
|
||||||
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
||||||
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"559k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"0.0k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"82.4k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"82.0k"`)
|
||||||
|
|
||||||
const packages = modules.files
|
const packages = modules.files
|
||||||
.filter(m => m.endsWith('package.json'))
|
.filter(m => m.endsWith('package.json'))
|
||||||
@ -109,11 +107,9 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
.sort()
|
.sort()
|
||||||
expect(packages).toMatchInlineSnapshot(`
|
expect(packages).toMatchInlineSnapshot(`
|
||||||
[
|
[
|
||||||
"@unhead/shared",
|
|
||||||
"db0",
|
"db0",
|
||||||
"devalue",
|
"devalue",
|
||||||
"hookable",
|
"hookable",
|
||||||
"packrup",
|
|
||||||
"unhead",
|
"unhead",
|
||||||
]
|
]
|
||||||
`)
|
`)
|
||||||
@ -123,7 +119,7 @@ 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(`"299k"`)
|
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"0.0k"`)
|
||||||
|
|
||||||
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
|
||||||
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1388k"`)
|
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1388k"`)
|
||||||
@ -135,7 +131,6 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
expect(packages).toMatchInlineSnapshot(`
|
expect(packages).toMatchInlineSnapshot(`
|
||||||
[
|
[
|
||||||
"@babel/parser",
|
"@babel/parser",
|
||||||
"@unhead/shared",
|
|
||||||
"@vue/compiler-core",
|
"@vue/compiler-core",
|
||||||
"@vue/compiler-dom",
|
"@vue/compiler-dom",
|
||||||
"@vue/compiler-ssr",
|
"@vue/compiler-ssr",
|
||||||
@ -149,7 +144,6 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
|
|||||||
"entities",
|
"entities",
|
||||||
"estree-walker",
|
"estree-walker",
|
||||||
"hookable",
|
"hookable",
|
||||||
"packrup",
|
|
||||||
"source-map-js",
|
"source-map-js",
|
||||||
"ufo",
|
"ufo",
|
||||||
"unhead",
|
"unhead",
|
||||||
|
Loading…
Reference in New Issue
Block a user