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

feat: add ESM build #193

Closed
wants to merge 1 commit into from
Closed

feat: add ESM build #193

wants to merge 1 commit into from

Conversation

znck
Copy link

@znck znck commented Aug 19, 2020

closes #192

znck added a commit to znck/graphql-request that referenced this pull request Aug 19, 2020
tsconfig.esm.json Show resolved Hide resolved
@@ -36,7 +38,7 @@
"dev:test": "jest --watch",
"format": "prettier --write .",
"prepublishOnly": "yarn build",
"build": "rm -rf dist && tsc -d",
"build": "rm -rf dist && tsc -d && tsc -p tsconfig.esm.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a tsconifg for cjs too please.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default tsconfig.json is already for cjs. Do you want me to create a tsconfig.cjs.json?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep please

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

package.json Show resolved Hide resolved
@Evalir
Copy link

Evalir commented Apr 6, 2021

Hi! I'd love to pick this up so we can get ESM going 😄 . Is there anything I should be aware of regarding this?

@jasonkuhrt
Copy link
Member

@Evalir just the comments you see here

@Evalir
Copy link

Evalir commented Apr 6, 2021

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

@jasonkuhrt jasonkuhrt changed the title add ESM build feat: add ESM build Apr 6, 2021
@benwoodward
Copy link

benwoodward commented May 17, 2021

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, benwoodward@a8bf1ca (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.

Copy link

@3imed-jaberi 3imed-jaberi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jasonkuhrt jasonkuhrt deleted the branch graffle-js:master January 26, 2023 02:00
@jasonkuhrt jasonkuhrt closed this Jan 26, 2023
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.

Publish ES module
5 participants