mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nuxt): add payload.client
plugin only for production build (#7498)
This commit is contained in:
parent
ac0b3a63a2
commit
9024d76165
@ -2,7 +2,7 @@ import { defineNuxtPlugin, loadPayload, addRouteMiddleware, isPrerendered } from
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
// Only enable behavior if initial page is prerendered
|
||||
// TOOD: Support hybrid
|
||||
// TOOD: Support hybrid and dev
|
||||
if (!isPrerendered()) {
|
||||
return
|
||||
}
|
||||
|
@ -174,7 +174,9 @@ async function initNuxt (nuxt: Nuxt) {
|
||||
})
|
||||
|
||||
// Add prerender payload support
|
||||
if (!nuxt.options.dev) {
|
||||
addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client'))
|
||||
}
|
||||
|
||||
// Track components used to render for webpack
|
||||
if (nuxt.options.builder === '@nuxt/webpack-builder') {
|
||||
|
Loading…
Reference in New Issue
Block a user