mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +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,
|
cwd: rootDir,
|
||||||
fileName: args.dotenv
|
fileName: args.dotenv
|
||||||
},
|
},
|
||||||
|
defaults: {
|
||||||
|
experimental: {
|
||||||
|
payloadExtraction: args.prerender ? true : undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
overrides: {
|
overrides: {
|
||||||
_generate: args.prerender
|
_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
|
* 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. */
|
/** Enable cross-origin prefetch using the Speculation Rules API. */
|
||||||
crossOriginPrefetch: false,
|
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: {
|
experimental: {
|
||||||
inlineSSRStyles: id => !!id && !id.includes('assets.vue'),
|
inlineSSRStyles: id => !!id && !id.includes('assets.vue'),
|
||||||
reactivityTransform: true,
|
reactivityTransform: true,
|
||||||
treeshakeClientOnly: true
|
treeshakeClientOnly: true,
|
||||||
|
payloadExtraction: true
|
||||||
},
|
},
|
||||||
appConfig: {
|
appConfig: {
|
||||||
fromNuxtConfig: true,
|
fromNuxtConfig: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user