Minifying GQL in production build #8990
Unanswered
RadomirNowak
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone
In my current project we're using graphql-codegen to generate types based on hosted schema.
We use
graphql-tagto write our queries in files likegql.ts, for example:I've just analyzed our production build and its huge, and my assumption is that its mainly because all gql queries inside of
index.jsare not minified, so all whitespaces etc. are preserved.Now I believe that just by minifying these gql statements we'd take down the size of the bundle by a lot. The question that I have is how or which options in
codegen.yml, or which plugins would allow me to do that?Below I'll post a snippet of our
codegen.yml. Any help appreciated, thanks!!Beta Was this translation helpful? Give feedback.
All reactions