Dave Stein
Dave Stein

Reputation: 9316

Why are there multiple script tags after building NextJS?

I ran next build followed by next start. It's still rendering with many JS files at once instead of a singular entrypoint.

enter image description here

Is there something I'm missing here? The docs make it seem as though this is all that's needed

enter image description here

Upvotes: 0

Views: 1090

Answers (1)

Ramakay
Ramakay

Reputation: 3135

The files you see are NextJS code splitting into functional and framework code , you can read more about it here

https://nextjs.org/blog/next-9-2#improved-code-splitting-strategy

I see a comment about a <script file in your head, Next will leave this alone because its just a tag being printed - if you need your own outside JS file to be served by Next, place it in the public directory.

Upvotes: 2

Related Questions