graphql-request icon indicating copy to clipboard operation
graphql-request copied to clipboard

feat: add ESM build

Open znck opened this issue 4 years ago • 4 comments

closes #192

znck avatar Aug 19 '20 05:08 znck

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 avatar Apr 06 '21 13:04 Evalir

@Evalir just the comments you see here

jasonkuhrt avatar Apr 06 '21 13:04 jasonkuhrt

Alright! I'll pick this up in the following days 😃

Evalir avatar Apr 06 '21 13:04 Evalir

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.

image

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.

benwoodward avatar May 17 '21 08:05 benwoodward