-
Notifications
You must be signed in to change notification settings - Fork 35
/
.size-limit.cjs
100 lines (99 loc) · 3.23 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/** @type {import('size-limit').SizeLimitConfig} */
const checks = [
{
name: "{ ApolloNextAppProvider, ApolloClient, InMemoryCache } from '@apollo/experimental-nextjs-app-support' (Browser ESM)",
path: "packages/experimental-nextjs-app-support/dist/index.browser.js",
import: "{ ApolloNextAppProvider, ApolloClient, InMemoryCache }",
},
{
name: "{ WrapApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client-react-streaming' (Browser ESM)",
path: "packages/client-react-streaming/dist/index.browser.js",
import: "{ WrapApolloProvider, ApolloClient, InMemoryCache }",
},
{
name: "{ buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport' (Browser ESM)",
path: "packages/client-react-streaming/dist/manual-transport.browser.cjs",
import: "{ buildManualDataTransport }",
},
{
name: "@apollo/client-react-streaming (Browser ESM)",
path: "packages/client-react-streaming/dist/index.browser.js",
},
{
name: "@apollo/client-react-streaming (SSR ESM)",
path: "packages/client-react-streaming/dist/index.ssr.js",
},
{
name: "@apollo/client-react-streaming (RSC ESM)",
path: "packages/client-react-streaming/dist/index.rsc.js",
},
{
name: "@apollo/client-react-streaming/manual-transport (Browser ESM)",
path: "packages/client-react-streaming/dist/manual-transport.browser.cjs",
},
{
name: "@apollo/client-react-streaming/manual-transport (SSR ESM)",
path: "packages/client-react-streaming/dist/manual-transport.ssr.cjs",
},
{
name: "@apollo/experimental-nextjs-app-support (Browser ESM)",
path: "packages/experimental-nextjs-app-support/dist/index.browser.js",
},
{
name: "@apollo/experimental-nextjs-app-support (SSR ESM)",
path: "packages/experimental-nextjs-app-support/dist/index.ssr.js",
},
{
name: "@apollo/experimental-nextjs-app-support (RSC ESM)",
path: "packages/experimental-nextjs-app-support/dist/index.rsc.js",
},
{
name: "@apollo/experimental-nextjs-app-support/rsc (RSC ESM)",
path: "packages/experimental-nextjs-app-support/dist/rsc/index.js",
},
];
module.exports = checks.map(
(check) =>
/** @type {import('size-limit').SizeLimitConfig} */ ({
...check,
import: check.import || "*",
modifyWebpackConfig(config) {
config.resolve = {
...config.resolve,
modules: ["node_modules"],
conditionNames: [
"import",
check.name.includes("Browser")
? "browser"
: check.name.includes("RSC")
? "react-server"
: check.name.includes("SSR")
? "node"
: "default",
],
};
return config;
},
ignore: [
...(check.ignore || []),
"rehackt",
"react",
"react-dom",
"@apollo/client",
"@graphql-typed-document-node/core",
"@wry/caches",
"@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",
],
})
);