Publish ESM (.mjs) entry point to npm
motiz88 opened this issue · 2 comments
While working on optimising the bundling of https://github.com/graphql/swapi-graphql — for reasons1 — I discovered that it was import
ing things from graphql-relay-js
, but that the latter, unlike graphql-js
, only had a CommonJS entry point published to npm.
It might be desirable to add an ES module build target to this package, modeled on what graphql-js
is already doing.
1 See https://twitter.com/motiz88/status/985110696668131328 - I'm investigating the claim that schema execution on the front-end is impractical due to graphql-js
's footprint in terms of bundle size. swapi-graphql
simply happens to be a good, accessible testbed for just that (thanks @IvanGoncharov for the tip! 🙏)
I've pretty much completed this on my publish-mjs
branch but hit webpack/webpack#7032 due to the use of Buffer
in utils/base64.js
. Looking for viable workarounds. UPDATE: I think I've found one, see #209.
Sorry for the long delay.
We plan to merge this lib into graphql-js to provide the better maintenance and attention it deserves.
This should happen over the next few months and so closing this since graphql-js already provides mjs files.