fix(nuxt): interopDefault for page component imports (#6468)

This commit is contained in:
pooya parsa 2022-08-09 20:25:35 +02:00 committed by GitHub
parent bf3511c2c3
commit 3e27c1c52b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -237,7 +237,7 @@ export function normalizeRoutes (routes: NuxtPage[], metaImports: Set<string> =
children: route.children ? normalizeRoutes(route.children, metaImports).routes : [],
meta: route.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(route.meta)}}` : metaImportName,
alias: `${metaImportName}?.alias || []`,
component: genDynamicImport(file)
component: genDynamicImport(file, { interopDefault: true })
}
}))
}

View File

@ -34,10 +34,9 @@ export default {
/**
* Split server bundle into multiple chunks and dynamically import them
*
* Note: Enabling this flag can cause hydration issues in some platform.
*
* @see https://github.com/nuxt/framework/issues/6432
*/
viteServerDynamicImports: false,
viteServerDynamicImports: true,
}
}