I have next.js app with large codebase, big redux store and heavy pages with lot of dynamic content.
I want build lightweight page on builder io and integrate into existing next.js project. I followed official integration guide and I noticed that all code that inside of _app.js loaded on my new builder page.
Are there any way to keep only builder.io code?
I even tried to load dynamically my bootstrap code into _app.js file but no luck, page weight stays the same - 7Mb.
My _app.js code with dynamic import:
import dynamic from 'next/dynamic'
const RootApp = dynamic(() => import('containers/RootApp'))
const builderPages = ['/landing/']
const _App = ({ Component, pageProps }) => {
if (typeof window !== 'undefined' && builderPages.includes(location?.pathname)) {
return <Component {...pageProps} />
}
return <RootApp component={Component} pageProps={pageProps} />
}
export default _App