mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt)!: enable payload extraction only for nuxi generate
(#9018)
This commit is contained in:
parent
fddc8b2e6e
commit
6e78f9dbb0
@ -27,6 +27,11 @@ export default defineNuxtCommand({
|
||||
cwd: rootDir,
|
||||
fileName: args.dotenv
|
||||
},
|
||||
defaults: {
|
||||
experimental: {
|
||||
payloadExtraction: args.prerender ? true : undefined
|
||||
}
|
||||
},
|
||||
overrides: {
|
||||
_generate: args.prerender
|
||||
}
|
||||
|
@ -77,7 +77,15 @@ export default defineUntypedSchema({
|
||||
/**
|
||||
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
|
||||
*/
|
||||
payloadExtraction: true,
|
||||
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
|
||||
}
|
||||
},
|
||||
|
||||
/** Enable cross-origin prefetch using the Speculation Rules API. */
|
||||
crossOriginPrefetch: false,
|
||||
|
3
test/fixtures/basic/nuxt.config.ts
vendored
3
test/fixtures/basic/nuxt.config.ts
vendored
@ -105,7 +105,8 @@ export default defineNuxtConfig({
|
||||
experimental: {
|
||||
inlineSSRStyles: id => !!id && !id.includes('assets.vue'),
|
||||
reactivityTransform: true,
|
||||
treeshakeClientOnly: true
|
||||
treeshakeClientOnly: true,
|
||||
payloadExtraction: true
|
||||
},
|
||||
appConfig: {
|
||||
fromNuxtConfig: true,
|
||||
|
Loading…
Reference in New Issue
Block a user