mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
fix(schema): show payloadExtraction
warning only when unset (#18516)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
ce45590120
commit
e42d63a25a
@ -27,11 +27,6 @@ export default defineNuxtCommand({
|
|||||||
cwd: rootDir,
|
cwd: rootDir,
|
||||||
fileName: args.dotenv
|
fileName: args.dotenv
|
||||||
},
|
},
|
||||||
defaults: {
|
|
||||||
experimental: {
|
|
||||||
payloadExtraction: args.prerender ? true : undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
overrides: {
|
overrides: {
|
||||||
logLevel: args['log-level'],
|
logLevel: args['log-level'],
|
||||||
_generate: args.prerender
|
_generate: args.prerender
|
||||||
|
@ -243,6 +243,10 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add prerender payload support
|
// Add prerender payload support
|
||||||
|
if (nuxt.options._generate && nuxt.options.experimental.payloadExtraction === undefined) {
|
||||||
|
console.warn('Using experimental payload extraction for full-static output. You can opt-out by setting `experimental.payloadExtraction` to `false`.')
|
||||||
|
nuxt.options.experimental.payloadExtraction = true
|
||||||
|
}
|
||||||
if (!nuxt.options.dev && nuxt.options.experimental.payloadExtraction) {
|
if (!nuxt.options.dev && nuxt.options.experimental.payloadExtraction) {
|
||||||
addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client'))
|
addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client'))
|
||||||
}
|
}
|
||||||
|
@ -117,15 +117,7 @@ export default defineUntypedSchema({
|
|||||||
/**
|
/**
|
||||||
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
|
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
|
||||||
*/
|
*/
|
||||||
payloadExtraction: {
|
payloadExtraction: undefined,
|
||||||
async $resolve(enabled, get) {
|
|
||||||
enabled = enabled ?? false
|
|
||||||
if (enabled) {
|
|
||||||
console.warn('Using experimental payload extraction for full-static output. You can opt-out by setting `experimental.payloadExtraction` to `false`.')
|
|
||||||
}
|
|
||||||
return enabled
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client
|
* Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client
|
||||||
|
Loading…
Reference in New Issue
Block a user