-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
.size-limit.cjs
58 lines (57 loc) · 1.34 KB
/
.size-limit.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const checks = [
{
path: "dist/apollo-client.min.cjs",
limit: "38042"
},
{
path: "dist/main.cjs",
import: "{ ApolloClient, InMemoryCache, HttpLink }"
},
{
path: "dist/index.js",
import: "{ ApolloClient, InMemoryCache, HttpLink }",
limit: "31971"
},
...[
"ApolloProvider",
"useQuery",
"useLazyQuery",
"useMutation",
"useSubscription",
"useSuspenseQuery",
"useBackgroundQuery",
"useReadQuery",
"useFragment"
].map((name) => ({ path: "dist/react/index.js", import: `{ ${name} }` })),
].map((config) => ({
...config,
name: config.name || config.import ? `import ${config.import} from "${config.path}"` : config.path,
ignore: [
...(config.ignore || []),
"react",
"react-dom",
"@graphql-typed-document-node/core",
"@wry/context",
"@wry/equality",
"@wry/trie",
"graphql-tag",
"hoist-non-react-statics",
"optimism",
"prop-types",
"response-iterator",
"symbol-observable",
"ts-invariant",
"tslib",
"zen-observable-ts"
],
})).flatMap((value) => value.path == "dist/apollo-client.min.cjs" ? value : [{...value, limit: undefined}, {
...value,
name: `${value.name} (production)`,
modifyEsbuildConfig(config){
config.define = {
"globalThis.__DEV__": `false`,
}
return config
}
}]);
module.exports = checks;