UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

14 lines (13 loc) 781 B
export { isClientSideRoutable }; import { analyzePageClientSideInit } from '../../shared/getPageFiles/analyzePageClientSide.js'; import { findPageConfig } from '../../shared/page-configs/findPageConfig.js'; import { analyzeClientSide } from '../../shared/getPageFiles/analyzeClientSide.js'; // TODO/next-major-release: make it sync async function isClientSideRoutable(pageId, pageContext) { await analyzePageClientSideInit(pageContext._pageFilesAll, pageId, { sharedPageFilesAlreadyLoaded: false, }); const pageConfig = findPageConfig(pageContext._globalContext._pageConfigs, pageId); const { isClientRuntimeLoaded, isClientRouting } = analyzeClientSide(pageConfig, pageContext._pageFilesAll, pageId); return isClientRuntimeLoaded && isClientRouting; }