-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix/umd-build #3924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/umd-build #3924
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,15 +38,15 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'query-core', | ||
packageDir: 'packages/query-core', | ||
jsName: 'QueryCore', | ||
outputFile: 'query-core', | ||
outputFile: 'index', | ||
entryFile: 'src/index.ts', | ||
globals: {}, | ||
}), | ||
...buildConfigs({ | ||
name: 'query-async-storage-persister', | ||
packageDir: 'packages/query-async-storage-persister', | ||
jsName: 'QueryAsyncStoragePersister', | ||
outputFile: 'query-async-storage-persister', | ||
outputFile: 'index', | ||
TkDodo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
entryFile: 'src/index.ts', | ||
globals: { | ||
'@tanstack/react-query-persist-client': 'ReactQueryPersistClient', | ||
|
@@ -56,7 +56,7 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'query-broadcast-client-experimental', | ||
packageDir: 'packages/query-broadcast-client-experimental', | ||
jsName: 'QueryBroadcastClient', | ||
outputFile: 'query-broadcast-client-experimental', | ||
outputFile: 'index', | ||
entryFile: 'src/index.ts', | ||
globals: { | ||
'@tanstack/query-core': 'QueryCore', | ||
|
@@ -67,7 +67,7 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'query-sync-storage-persister', | ||
packageDir: 'packages/query-sync-storage-persister', | ||
jsName: 'QuerySyncStoragePersister', | ||
outputFile: 'query-sync-storage-persister', | ||
outputFile: 'index', | ||
entryFile: 'src/index.ts', | ||
globals: { | ||
'@tanstack/react-query-persist-client': 'ReactQueryPersistClient', | ||
|
@@ -77,7 +77,7 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'react-query', | ||
packageDir: 'packages/react-query', | ||
jsName: 'ReactQuery', | ||
outputFile: 'react-query', | ||
outputFile: 'index', | ||
entryFile: 'src/index.ts', | ||
globals: { | ||
react: 'React', | ||
|
@@ -88,7 +88,7 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'react-query-devtools', | ||
packageDir: 'packages/react-query-devtools', | ||
jsName: 'ReactQueryDevtools', | ||
outputFile: 'react-query-devtools', | ||
outputFile: 'index', | ||
entryFile: 'src/index.ts', | ||
globals: { | ||
react: 'React', | ||
|
@@ -99,7 +99,7 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'react-query-devtools-noop', | ||
packageDir: 'packages/react-query-devtools', | ||
jsName: 'ReactQueryDevtools', | ||
outputFile: 'react-query-devtools', | ||
outputFile: 'noop', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting this to |
||
entryFile: 'src/noop.ts', | ||
globals: { | ||
react: 'React', | ||
|
@@ -110,7 +110,7 @@ export default function rollup(options: RollupOptions): RollupOptions[] { | |
name: 'react-query-persist-client', | ||
packageDir: 'packages/react-query-persist-client', | ||
jsName: 'ReactQueryPersistClient', | ||
outputFile: 'react-query-persist-client', | ||
outputFile: 'index', | ||
entryFile: 'src/index.ts', | ||
globals: { | ||
react: 'React', | ||
|
@@ -205,7 +205,7 @@ function umdDev({ | |
output: { | ||
format: 'umd', | ||
sourcemap: true, | ||
file: `${packageDir}/build/umd/index.development.js`, | ||
file: `${packageDir}/build/umd/${outputFile}.development.js`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since all UMD builds were generating an output file with the |
||
name: jsName, | ||
globals, | ||
banner, | ||
|
@@ -236,7 +236,7 @@ function umdProd({ | |
output: { | ||
format: 'umd', | ||
sourcemap: true, | ||
file: `${packageDir}/build/umd/index.production.js`, | ||
file: `${packageDir}/build/umd/${outputFile}.production.js`, | ||
name: jsName, | ||
globals, | ||
banner, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should allow for older bundlers (e.g. Webpack 4) to properly resolve
@tanstack/react-query-devtools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that we should remove
browser
field from all packages.UMD build should be linked directly from CDN.
We do not ship separate code for
node
andbrowser
(ie. xxx.server.js and xxx.client.js), so we could stick tomain
field.Or remap all packages this way.