-
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.
Merge branch 'cloneDeepSymbols' of https://github.com/MrDoomBringer/a…
…pollo-client into cloneDeepSymbols
- Loading branch information
Showing
10 changed files
with
124 additions
and
1,603 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
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,26 @@ | ||
import { readFileSync } from "fs"; | ||
import { join } from "path"; | ||
import { gzipSync } from "zlib"; | ||
import bytes from "bytes"; | ||
|
||
const gzipBundleByteLengthLimit = bytes("31.85KB"); | ||
const minFile = join("dist", "apollo-client.min.cjs"); | ||
const minPath = join(__dirname, "..", minFile); | ||
const gzipByteLen = gzipSync(readFileSync(minPath)).byteLength; | ||
const overLimit = gzipByteLen > gzipBundleByteLengthLimit; | ||
|
||
const message = `Minified + GZIP-encoded bundle size for ${ | ||
minFile | ||
} = ${ | ||
bytes(gzipByteLen, { unit: "KB" }) | ||
}, ${ | ||
overLimit ? "exceeding" : "under" | ||
} limit ${ | ||
bytes(gzipBundleByteLengthLimit, { unit: "KB" }) | ||
}`; | ||
|
||
if (overLimit) { | ||
throw new Error(message); | ||
} else { | ||
console.log(message); | ||
} |
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
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
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
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
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
Oops, something went wrong.