dotansimha / dotansimha/graphql-code-generator

Advice for bundle reduction for client-preset Vite/Vue setup

Open
#9,457 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

### Is your feature request related to a problem? Please describe.

The [current documentation](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size-babel-plugin) for reducing bundle size on client/preset doesn't provide info that is relevant to a regular vite/vue setup.

A comment in the generated gql.ts recommends using a babel or swc plugin but it's not clear how that applies to a vite setup where neither babel or swc is used.

### Describe the solution you'd like

Ideally I think there would be a dedicated vite plugin (that doesn't rely on react) with an example in the documentation.

### Describe alternatives you've considered

It may be possible to use the babel plugin with @rollup/plugin-babel but I haven't tried it yet. If that is an adequate solution then it should probably be added to the docs.

### Is your feature request related to a problem? Please describe.

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.