Skip to content

Commit 37a786b

Browse files
committed
fix: umd build size
1 parent 2452ec1 commit 37a786b

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

packages/react-query-devtools/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@
4242
"clean": "rm -rf ./build",
4343
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src"
4444
},
45+
"devDependencies": {
46+
"@types/use-sync-external-store": "^0.0.3"
47+
},
4548
"dependencies": {
4649
"@tanstack/match-sorter-utils": "^8.1.1",
47-
"@types/use-sync-external-store": "^0.0.3",
4850
"use-sync-external-store": "^1.2.0"
4951
},
5052
"peerDependencies": {

packages/react-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
],
4242
"devDependencies": {
4343
"@types/jscodeshift": "^0.11.3",
44+
"@types/use-sync-external-store": "^0.0.3",
4445
"jscodeshift": "^0.13.1",
4546
"react-error-boundary": "^3.1.4"
4647
},
4748
"dependencies": {
4849
"@tanstack/query-core": "4.3.0-beta.3",
49-
"@types/use-sync-external-store": "^0.0.3",
5050
"use-sync-external-store": "^1.2.0"
5151
},
5252
"peerDependencies": {

rollup.config.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ export default function rollup(options: RollupOptions): RollupOptions[] {
8383
react: 'React',
8484
'react-dom': 'ReactDOM',
8585
'@tanstack/query-core': 'QueryCore',
86+
'use-sync-external-store/shim/index.js': 'UseSyncExternalStore',
8687
},
87-
bundleUMDGlobals: ['@tanstack/query-core'],
88+
bundleUMDGlobals: [
89+
'@tanstack/query-core',
90+
'use-sync-external-store/shim/index.js',
91+
],
8892
}),
8993
...buildConfigs({
9094
name: 'react-query-devtools',
@@ -94,8 +98,15 @@ export default function rollup(options: RollupOptions): RollupOptions[] {
9498
entryFile: 'src/index.ts',
9599
globals: {
96100
react: 'React',
101+
'react-dom': 'ReactDOM',
97102
'@tanstack/react-query': 'ReactQuery',
103+
'@tanstack/match-sorter-utils': 'MatchSorterUtils',
104+
'use-sync-external-store/shim/index.js': 'UseSyncExternalStore',
98105
},
106+
bundleUMDGlobals: [
107+
'@tanstack/match-sorter-utils',
108+
'use-sync-external-store/shim/index.js',
109+
],
99110
}),
100111
...buildConfigs({
101112
name: 'react-query-devtools-noop',
@@ -154,7 +165,12 @@ function buildConfigs(opts: {
154165
globals: opts.globals,
155166
}
156167

157-
return [esm(options), cjs(options), umdDev({...options, external: umdExternal}), umdProd({...options, external: umdExternal})]
168+
return [
169+
esm(options),
170+
cjs(options),
171+
umdDev({ ...options, external: umdExternal }),
172+
umdProd({ ...options, external: umdExternal }),
173+
]
158174
}
159175

160176
function esm({ input, packageDir, external, banner }: Options): RollupOptions {

0 commit comments

Comments
 (0)