Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ESM build for tree-shaking #1238

Closed
wants to merge 3 commits into from
Closed

Add ESM build for tree-shaking #1238

wants to merge 3 commits into from

Conversation

sheepsteak
Copy link

@sheepsteak sheepsteak commented Nov 9, 2019

TODO:

  • If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change. Include a description of your change, link to PR (always) and issue (if applicable). Add your CHANGELOG entry under vNEXT. Do not create a new version number for your change yourself.

Prior discussion of this in #343 and #344.

  • Produce build with ESM modules in it into es folder
  • Fix require in tests by using esModuleInterop into tsconfig.json
  • Add module field so that tooling can find the ESM build

Once merged the ESM build will just get done alongside the ES5 build. I did npm pack to make sure the es folder will get included.

I linked this version into an AWS Lambda function where I'm only importing makeExecutableSchema and nothing else from graphql-tools. I saw a 100KiB reduction in a production build size.

@apollo-cla
Copy link

@sheepsteak: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@yaacovCR
Copy link
Collaborator

yaacovCR commented Apr 1, 2020

Closed in favor of #1320

@yaacovCR yaacovCR closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants