Socket
Socket
Sign inDemoInstall

@nuxt/schema

Package Overview
Dependencies
Maintainers
5
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxt/schema - npm Package Compare versions

Comparing version 3.2.3 to 3.3.0

22

package.json
{
"name": "@nuxt/schema",
"version": "3.2.3",
"version": "3.3.0",
"repository": "nuxt/nuxt",
"license": "MIT",
"type": "module",
"main": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
},
"./package.json": "./package.json"
},
"files": [

@@ -16,6 +22,6 @@ "dist",

"@types/semver": "^7.3.13",
"@unhead/schema": "^1.1.14",
"@unhead/schema": "^1.1.23",
"@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue-jsx": "^3.0.0",
"nitropack": "^2.2.3",
"nitropack": "~2.3.1",
"unbuild": "latest",

@@ -25,7 +31,7 @@ "vite": "~4.1.4"

"dependencies": {
"c12": "^1.1.2",
"c12": "^1.2.0",
"create-require": "^1.1.1",
"defu": "^6.1.2",
"hookable": "^5.4.2",
"jiti": "^1.17.1",
"hookable": "^5.5.0",
"jiti": "^1.17.2",
"pathe": "^1.1.0",

@@ -37,3 +43,3 @@ "pkg-types": "^1.0.2",

"ufo": "^1.1.1",
"unimport": "^2.2.4",
"unimport": "^3.0.2",
"untyped": "^1.2.2"

@@ -40,0 +46,0 @@ },

@@ -250,2 +250,11 @@ import type { ComponentsOptions } from '../src/types/components'

/**
* Log level when building logs.
*
* Defaults to 'silent' when running in CI or when a TTY is not available. This option is then used as 'silent' in Vite and 'none' in Webpack
*
* @default "info"
*/
logLevel: 'silent' | 'info' | 'verbose',
/**
* Shared build configuration.

@@ -263,3 +272,3 @@ *

* ```js
* transpile: [({ isLegacy }) => isLegacy && 'ky']
* transpile: [({ isLegacy }) => isLegacy && 'ky']
* ```

@@ -309,2 +318,43 @@ */

/**
* Build time optimization configuration.
*
*/
optimization: {
/**
* Functions to inject a key for.
*
* As long as the number of arguments passed to the function is less than `argumentLength`, an additional magic string will be injected that can be used to deduplicate requests between server and client. You will need to take steps to handle this additional key.
* The key will be unique based on the location of the function being invoked within the file.
*
* @default [{"name":"useState","argumentLength":2},{"name":"useFetch","argumentLength":3},{"name":"useAsyncData","argumentLength":3},{"name":"useLazyAsyncData","argumentLength":3},{"name":"useLazyFetch","argumentLength":3}]
*/
keyedComposables: Array<{ name: string, argumentLength: number }>,
/**
* Tree shake code from specific builds.
*
*/
treeShake: {
/**
* Tree shake composables from the server or client builds.
*
*
* @example
* ```js
* treeShake: { client: { myPackage: ['useServerOnlyComposable'] } }
* ```
*/
composables: {
server: {
[key: string]: any
},
client: {
[key: string]: any
},
},
},
},
/**
* Extend project from multiple local or remote sources.

@@ -509,2 +559,9 @@ *

/**
* The modules directory, each file in which will be auto-registered as a Nuxt module.
*
* @default "modules"
*/
modules: string,
/**
* The directory which will be processed to auto-generate your application page routes.

@@ -619,2 +676,10 @@ *

/**
* The watch property lets you define patterns that will restart the Nuxt dev server when changed.
*
* It is an array of strings or regular expressions, which will be matched against the file path relative to the project `srcDir`.
*
*/
watch: Array<string | RegExp>,
/**
* The watchers property lets you overwrite watchers configuration in your `nuxt.config`.

@@ -720,11 +785,10 @@ *

* ```
* import { fileURLToPath } from 'node:url'
* export default {
* server: {
* export default defineNuxtConfig({
* devServer: {
* https: {
* key: fs.readFileSync(fileURLToPath(new URL('./server.key', import.meta.url))),
* cert: fs.readFileSync(fileURLToPath(new URL('./server.crt', import.meta.url)))
* key: './server.key',
* cert: './server.crt'
* }
* }
* }
* })
* ```

@@ -796,11 +860,22 @@ */

*
* You can set this to `reload` to perform a hard reload of the new route when a chunk fails to load when navigating to a new route.
* By default, Nuxt will also perform a hard reload of the new route when a chunk fails to load when navigating to a new route.
* You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`.
*
* @default false
* @default "automatic"
*
* @see https://github.com/nuxt/nuxt/pull/19038
*/
emitRouteChunkError: boolean | 'reload',
emitRouteChunkError: false | 'manual' | 'automatic',
/**
* Whether to restore Nuxt app state from `sessionStorage` when reloading the page after a chunk error or manual `reloadNuxtApp()` call.
*
* To avoid hydration errors, it will be applied only after the Vue app has been mounted, meaning there may be a flicker on initial load.
* Consider carefully before enabling this as it can cause unexpected behavior, and consider providing explicit keys to `useState` as auto-generated keys may not match across builds.
*
* @default false
*/
restoreState: boolean,
/**
* Use vite-node for on-demand server chunk loading

@@ -842,5 +917,11 @@ *

*
*/
payloadExtraction: any,
/**
* Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client if there's an error in SSR.
*
* @default false
*/
payloadExtraction: boolean,
clientFallback: boolean,

@@ -871,5 +952,5 @@ /**

/**
* Enable experimental config schema support
* Config schema support
*
* @default false
* @default true
*

@@ -879,2 +960,11 @@ * @see https://github.com/nuxt/nuxt/issues/15592

configSchema: boolean,
/**
* Whether or not to add a compatibility layer for modules, plugins or user code relying on the old `@vueuse/head` API.
*
* This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb.
*
* @default true
*/
polyfillVueUseHead: boolean,
},

@@ -1004,3 +1094,3 @@

*
* @see https://nitro.unjs.io/config/#routes
* @see https://nitro.unjs.io/config/#routerules
*/

@@ -1032,3 +1122,3 @@ routeRules: NitroConfig['routeRules'],

*
* @see https://nitro.unjs.io/guide/introduction/routing
* @see https://nitro.unjs.io/guide/routing
*/

@@ -1035,0 +1125,0 @@ devServerHandlers: NitroDevEventHandler[],

@@ -7,3 +7,2 @@ {

"mode": "production",
"logLevel": "info",
"define": {

@@ -41,3 +40,3 @@ "process.dev": false

},
"clearScreen": false,
"clearScreen": true,
"build": {

@@ -109,2 +108,3 @@ "assetsDir": "_nuxt/",

"middleware": "middleware",
"modules": "modules",
"pages": "pages",

@@ -131,2 +131,50 @@ "plugins": "plugins",

},
"logLevel": "info",
"optimization": {
"keyedComposables": [
{
"name": "useState",
"argumentLength": 2
},
{
"name": "useFetch",
"argumentLength": 3
},
{
"name": "useAsyncData",
"argumentLength": 3
},
{
"name": "useLazyAsyncData",
"argumentLength": 3
},
{
"name": "useLazyFetch",
"argumentLength": 3
}
],
"treeShake": {
"composables": {
"server": {
"vue": [
"onBeforeMount",
"onMounted",
"onBeforeUpdate",
"onRenderTracked",
"onRenderTriggered",
"onActivated",
"onDeactivated",
"onBeforeUnmount"
]
},
"client": {
"vue": [
"onServerPrefetch",
"onRenderTracked",
"onRenderTriggered"
]
}
}
}
},
"extends": null,

@@ -164,2 +212,3 @@ "theme": null,

],
"watch": [],
"watchers": {

@@ -195,3 +244,4 @@ "rewatchOnRawEvents": {},

"treeshakeClientOnly": true,
"emitRouteChunkError": false,
"emitRouteChunkError": "automatic",
"restoreState": false,
"viteNode": true,

@@ -201,7 +251,9 @@ "viteServerDynamicImports": true,

"noScripts": false,
"payloadExtraction": false,
"payloadExtraction": {},
"clientFallback": false,
"crossOriginPrefetch": false,
"writeEarlyHints": false,
"componentIslands": false,
"configSchema": false
"configSchema": true,
"polyfillVueUseHead": true
},

@@ -208,0 +260,0 @@ "generate": {

@@ -147,2 +147,12 @@

# `logLevel`
- **Type**: `'silent' | 'info' | 'verbose'`
- **Default**: `"info"`
> Log level when building logs.
Defaults to 'silent' when running in CI or when a TTY is not available. This option is then used as 'silent' in Vite and 'none' in Webpack
# `build`

@@ -180,2 +190,23 @@

# `optimization`
## `keyedComposables`
- **Type**: `Array<{ name: string, argumentLength: number }>`
- **Default**: `[{"name":"useState","argumentLength":2},{"name":"useFetch","argumentLength":3},{"name":"useAsyncData","argumentLength":3},{"name":"useLazyAsyncData","argumentLength":3},{"name":"useLazyFetch","argumentLength":3}]`
> Functions to inject a key for.
As long as the number of arguments passed to the function is less than `argumentLength`, an additional magic string will be injected that can be used to deduplicate requests between server and client. You will need to take steps to handle this additional key.
The key will be unique based on the location of the function being invoked within the file.
## `treeShake`
### `composables`
#### `server`
#### `client`
# `extends`

@@ -334,2 +365,9 @@ - **Type**: `string|string[]`

## `modules`
- **Type**: `string`
- **Default**: `"modules"`
> The modules directory, each file in which will be auto-registered as a Nuxt module.
## `pages`

@@ -391,2 +429,12 @@ - **Type**: `string`

# `watch`
- **Type**: `Array<string | RegExp>`
- **Default**: `[]`
> The watch property lets you define patterns that will restart the Nuxt dev server when changed.
It is an array of strings or regular expressions, which will be matched against the file path relative to the project `srcDir`.
# `watchers`

@@ -502,4 +550,4 @@

## `emitRouteChunkError`
- **Type**: `boolean | 'reload'`
- **Default**: `false`
- **Type**: `false | 'manual' | 'automatic'`
- **Default**: `"automatic"`

@@ -509,5 +557,17 @@ > Emit `app:chunkError` hook when there is an error loading vite/webpack chunks.

You can set this to `reload` to perform a hard reload of the new route when a chunk fails to load when navigating to a new route.
By default, Nuxt will also perform a hard reload of the new route when a chunk fails to load when navigating to a new route.
You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`.
## `restoreState`
- **Type**: `boolean`
- **Default**: `false`
> Whether to restore Nuxt app state from `sessionStorage` when reloading the page after a chunk error or manual `reloadNuxtApp()` call.
To avoid hydration errors, it will be applied only after the Vue app has been mounted, meaning there may be a flicker on initial load.
Consider carefully before enabling this as it can cause unexpected behavior, and consider providing explicit keys to `useState` as auto-generated keys may not match across builds.
## `viteNode`

@@ -545,6 +605,13 @@ - **Type**: `boolean`

## `payloadExtraction`
- **Type**: `any`
- **Default**: `{}`
> When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
## `clientFallback`
- **Type**: `boolean`
- **Default**: `false`
> When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
> Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client if there's an error in SSR.

@@ -575,7 +642,17 @@

- **Type**: `boolean`
- **Default**: `false`
- **Default**: `true`
> Enable experimental config schema support
> Config schema support
## `polyfillVueUseHead`
- **Type**: `boolean`
- **Default**: `true`
> Whether or not to add a compatibility layer for modules, plugins or user code relying on the old `@vueuse/head` API.
This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb.
# `generate`

@@ -787,7 +864,2 @@

## `logLevel`
- **Type**: `string`
- **Default**: `"info"`
## `define`

@@ -846,3 +918,3 @@

- **Type**: `boolean`
- **Default**: `false`
- **Default**: `true`

@@ -849,0 +921,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc