Graphql-tag: Exporting as ES Module Syntax (ESM)

Created on 23 Dec 2018  Â·  10Comments  Â·  Source: apollographql/graphql-tag

Please, export "module" entry point in the package.json as ES Module Syntax (ESM).

More info about it here: https://www.pikapkg.com/about/

How to reproduce the issue:

Just download the package or see it at unpkg:
https://unpkg.com/[email protected]/src/index.js?module.

All 10 comments

@JoviDeCroock If you have not seen it, I suppose it may be of your interest 🙂

Introducing: @pika/pack
npm package building, reimagined

Any news on this? Thanks in advance!

I have done a PR, there I got asked to convert this repository to TypeScript first but since no maintainer has been active on the repository.

Ouch! 😢

Thanks anyway for your work!

Well, on the bright side it is not that you would be able to tree shake anything anyway so using the CJS is functionally equivalent.

I'm really thinking about rewrite this to typescript + emitting .ts files for better developer experience.
There is no simple tool ATM, so I will try my best to emit input and output types for native typescript, so VSCode and other languageservices can benefit from.. Ask me after week please if you are interested

@langpavel already doing this but waiting for merge, you can always help out by making PR's to the /typescript branch.

@JoviDeCroock I must break for some days, but here is what I do last week:

  • loader emits just wrapper to load generated .ts file
  • require(...) → require(...).default
  • Does NOT emit valid type information (not yet)

https://gist.github.com/langpavel/ffd6ecb5ba655b7b4bff3ebdca0942f0

@langpavel Do it on the official repo

Is there any hope for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

k picture k  Â·  8Comments

jnwng picture jnwng  Â·  7Comments

stevezau picture stevezau  Â·  4Comments

codepunkt picture codepunkt  Â·  7Comments

jesenko picture jesenko  Â·  7Comments