Skip to content

Commit

Permalink
remove global __DEV__ type in postprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Jul 6, 2023
1 parent 9bd37a3 commit 03ff6c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions config/postprocessDist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import * as path from "path";
import resolve from "resolve";
import { distDir, eachFile, reparse, reprint } from './helpers';

const globalTypesFile = path.resolve(distDir, "utilities/globals/global.d.ts");
fs.writeFileSync(globalTypesFile,
fs.readFileSync(globalTypesFile, "utf8")
.split("\n")
.filter(line => line.trim() !== 'const __DEV__: boolean;')
.join("\n"),
"utf8"
);

// The primary goal of the 'npm run resolve' script is to make ECMAScript
// modules exposed by Apollo Client easier to consume natively in web browsers,
// without bundling, and without help from package.json files. It accomplishes
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/globals/global.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { maybe } from "./maybe";

declare global {
const __DEV__: boolean;
const __DEV__: boolean; // will be removed in `dist` by the `postprocessDist` script
interface Window {
__DEV__?: boolean;
}
Expand Down

0 comments on commit 03ff6c4

Please sign in to comment.