Loads GraphQL .gql and .graphql files as ES modules, for Vite and for Bun.
| Package | npm | Use with |
|---|---|---|
vite-plugin-graphql-loader |
npm | Vite 5, 6, 7, 8 |
bun-graphql-loader |
npm | bun build, bun test |
packages/core shared transform + the snippets injected into emitted modules
packages/vite -> vite-plugin-graphql-loader
packages/bun -> bun-graphql-loader
tests shared fixtures, run under vitest and bun test
integration-test a real Vite build consuming the published package layout
bun install
bun run test:run # vitest (shared fixtures) + bun test (Bun runtime/build)
bun run typecheck
bun run lint
bun run build # builds both packagesThe tests/testcases fixtures are golden files. Delete a -expected.js and
re-run the tests twice to regenerate it.
Tags select the package: vite-v6.0.0 publishes packages/vite,
bun-v2.0.0 publishes packages/bun. Both are setup to use npm Trusted
Publishing.