Should node_modules exist in client-side JS?
Unanswered
Griffon Nivernais posted this in #help-forum
Griffon NivernaisOP
Using
@next/bundle-analyzer to find out how to optimise high initial load JS, and I see node_modules included for some reason. Does this mean it gets shipped to the client, and if this should be happening?6 Replies
@Griffon Nivernais Using `@next/bundle-analyzer` to find out how to optimise high initial load JS, and I see node_modules included for some reason. Does this mean it gets shipped to the client, and if this should be happening?
it ships all that is nessary for you app... this just means that some packages came from node_modules (ie next and @sentry/nextjs)
Griffon NivernaisOP
Hmm, I see.
I did try to reduce the amount of initial load JS but it's proven tricky. Things like Sentry aren't really able to be dynamically imported for some reason. I'll give it another try and see if I can exclude it from the client side.
nextjs isn't the best for initial js ðŸ˜
dynamic import seems to just prevent ssr and not change bundle from my experience
Griffon NivernaisOP
I'll keep that in mind, thank you still!