-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "experiment: remove
graphql
package esm fix"
This reverts commit 930783b.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// The ordering of these imports is important, because it ensures the temporary | ||
// process.env.NODE_ENV polyfill is defined globally (if necessary) before we | ||
// import { Source } from 'graphql'. The instanceOf function that we really care | ||
// about (the one that uses process.env.NODE_ENV) is not exported from the | ||
// top-level graphql package, but graphql/language/source uses instanceOf, and | ||
// has relatively few dependencies, so importing it here should not increase | ||
// bundle sizes as much as other options. | ||
import { remove } from 'ts-invariant/process'; | ||
import { Source } from 'graphql'; | ||
|
||
export function removeTemporaryGlobals() { | ||
// Using Source here here just to make sure it won't be tree-shaken away. | ||
return typeof Source === "function" ? remove() : remove(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters