Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there way to fetch other chunks with main.js? #214

Open
intelcoder opened this issue Mar 23, 2021 · 2 comments
Open

Is there way to fetch other chunks with main.js? #214

intelcoder opened this issue Mar 23, 2021 · 2 comments

Comments

@intelcoder
Copy link

I am working on some performance improvement. When I check my performance profile, It fetches main.js which is not small. Then, it start to fetch other required chunks.

I looked at the site using Nextjs and it seem to fetch small buildManifest and start to fetch all he required chunk at the same time.

My site is waiting for the main.js because of my webpack setup or you believe I have wrong setup with react-imported-component?

@theKashey
Copy link
Owner

NextJs works a little different from other applications, having something like "full per-page builds", especially in dev mode.

The "normal" application is expected to have "entrypoint code" (aka main), with possible separated "vendors" bundle, and a pack of small chunks required to serve a particular request. Your job in this case is basically keep that entry point as small as possible.

Speaking of "build manifest" - all you need is to set runtimeChunk and webpack will extract it as a separate file. However in this case you will need to have some extra tool to "combine everything back" or loading will never complete.

I personally use webpack-imported

@intelcoder
Copy link
Author

That means that even though I separate the manifest file, loading chunks still depends on main chunk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants