You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project with Next.js and Apollo Client that has a bunch of server-side rendered pages. And I generate Apollo hooks into a single file. Here is my codegen.yml
There are a bunch of other pages and what I have noticed is that all of the generated hooks that are needed only for those pages go into the settings page js chunck.
Do you know if this is the default behaviour for Next.js apps? The generated file seems tree-shakable but unexpectedly for me, it isn't. I wonder if I should update webpack config somehow (although tree shaking works in the rest of my project) or should I take another approach and have the hooks in separate files?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I have a project with Next.js and Apollo Client that has a bunch of server-side rendered pages. And I generate Apollo hooks into a single file. Here is my
codegen.yml
I import one of my hooks
useProfile
intosettings.tsx
that looks something like this:There are a bunch of other pages and what I have noticed is that all of the generated hooks that are needed only for those pages go into the settings page js chunck.
Do you know if this is the default behaviour for Next.js apps? The generated file seems tree-shakable but unexpectedly for me, it isn't. I wonder if I should update webpack config somehow (although tree shaking works in the rest of my project) or should I take another approach and have the hooks in separate files?
Beta Was this translation helpful? Give feedback.
All reactions