graphql-request
graphql-request copied to clipboard
feat: add ESM build
closes #192
Hi! I'd love to pick this up so we can get ESM
going 😄 . Is there anything I should be aware of regarding this?
@Evalir just the comments you see here
Alright! I'll pick this up in the following days 😃
I'm trying to get graphql-request
working with sveltekit
/vite
and struggling. Installed from znck's branch (had to downgrade to node 12 for this to not throw node-gyp
related errors): npm i -D znck/graphql-request#master
, however, the graphql-request
directory in node_modules
only contains an empty package.json
, a README.md
and a license.
What do I need to do to fix this, other than fix these conflicts ↑?
EDIT: I guess the reason the directory is empty is because yarn build
only gets run via the prepublishOnly
script command (which is only triggered via npm publish
), and installing directly from github means that I end up with a copy of the package that hasn't been built.
EDIT: Adding a prepare
script command seems to fix the project not building on install issue, https://github.com/benwoodward/graphql-request/commit/a8bf1ca823b9449844574883a408aed69ec4d1fe (when installing locally or from Github). If you're trying to get graphql-request
working with Vite/Sveltekit you can install my fork using npm install -D benwoodward/graphql-request#fix/esm-build
until this PR is resolved.