mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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,
|
||||
fileName: args.dotenv
|
||||
},
|
||||
defaults: {
|
||||
experimental: {
|
||||
payloadExtraction: args.prerender ? true : undefined
|
||||
}
|
||||
},
|
||||
overrides: {
|
||||
logLevel: args['log-level'],
|
||||
_generate: args.prerender
|
||||
|
@ -243,6 +243,10 @@ async function initNuxt (nuxt: Nuxt) {
|
||||
}
|
||||
|
||||
// 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) {
|
||||
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
|
||||
*/
|
||||
payloadExtraction: {
|
||||
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
|
||||
}
|
||||
},
|
||||
payloadExtraction: undefined,
|
||||
|
||||
/**
|
||||
* Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client
|
||||
|
Loading…
Reference in New Issue
Block a user