Skip to content

Commit

Permalink
Guide tree-shaking by calling checkDEV() in `utilities/globals/inde…
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn authored Sep 10, 2021
1 parent f73e7be commit e0ea45c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Apollo Client 3.4.11 (not yet released)

### Bug Fixes

- Fix [Vite](https://vitejs.dev) tree-shaking by calling the `checkDEV()` function (at least once) in the module that exports it, `@apollo/client/utilities/globals/index.ts`. <br/>
[@benjamn](https://github.com/benjamn) in [#8767](https://github.com/apollographql/apollo-client/pull/8767)

## Apollo Client 3.4.10

### Improvements
Expand Down
4 changes: 4 additions & 0 deletions src/utilities/globals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ removeTemporaryGlobals();
export { maybe } from "./maybe";
export { default as global } from "./global";
export { invariant, InvariantError }

// Ensure __DEV__ was properly initialized, and prevent tree-shaking bundlers
// from mistakenly pruning the ./DEV module (see issue #8674).
checkDEV();

0 comments on commit e0ea45c

Please sign in to comment.