Skip to content

Commit d708da2

Browse files
committed
Notes about browser use
mention webpack and rollup support and dual-module support. Closes #1272
1 parent 60c03ab commit d708da2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ directly on this branch:
119119
npm install graphql@git://github.com/graphql/graphql-js.git#npm
120120
```
121121

122+
### Using in a Browser
123+
124+
GraphQL.js is a general purpose library and can be used both in a Node server
125+
and in the browser. As an example, the [GraphiQL](https://github.com/graphql/graphiql/)
126+
tool is built with GraphQL.js!
127+
128+
Building a project using GraphQL.js with [webpack](https://webpack.js.org) or
129+
[rollup](https://github.com/rollup/rollup) should just work and only include
130+
the portions of the library you use. This works because GraphQL.js is distributed
131+
with both CommonJS (`require()`) and ESModule (`import`) files. Ensure that any
132+
custom build configurations look for `.mjs` files!
133+
122134
### Contributing
123135

124136
We actively welcome pull requests, learn how to

0 commit comments

Comments
 (0)