Skip to content

fix(devtools): Update ESM export extension #5364

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

Merged
merged 3 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
"types": "build/types/index.d.ts",
"main": "build/umd/index.js",
"module": "build/esm/index.js",
"module": "build/esm/index.mjs",
"exports": {
".": {
"types": "./build/types/index.d.ts",
"import": "./build/esm/index.js",
"import": "./build/esm/index.mjs",
"require": "./build/umd/index.js",
"default": "./build/umd/index.js"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte-query-devtools/src/Devtools.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export let errorTypes: DevToolsErrorType[] = []

let ref: HTMLDivElement
let devtools: TanstackQueryDevtools
let devtools: TanstackQueryDevtools | undefined

if (DEV && BROWSER) {
onMount(async () => {
Expand All @@ -37,7 +37,7 @@
devtools.mount(ref)

return () => {
devtools.unmount()
devtools?.unmount()
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-query-devtools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"paths": {
"@tanstack/query-core": ["../query-core/src"],
"@tanstack/query-devtools": ["../query-devtools/src"],
"@tanstack/svelte-query": ["../svelte-query/src"],
"@tanstack/svelte-query": ["../svelte-query/src"]
},
"references": [
{ "path": "../query-core" },
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"scripts": {
"clean": "rimraf ./build",
"test:types": "svelte-check --tsconfig ./tsconfig.json",
"test:types": "svelte-check --tsconfig ./tsconfig.json && tsc --emitDeclarationOnly --declaration --outDir build/lib",
"test:eslint": "eslint --ext .svelte,.ts ./src",
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
Expand Down
1 change: 0 additions & 1 deletion packages/svelte-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"lib": ["esnext", "DOM", "DOM.Iterable"],
"moduleResolution": "node",
"module": "esnext",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ function createTanstackQueryDevtoolsConfig() {
outputs.forEach((output) => {
const format = output.format
output.dir = `${packageDir}/build/${format}`
if (output.format === 'esm') {
output.dir = undefined
output.file = `${packageDir}/build/${format}/index.mjs`
}
})

solidRollupOptions.external = []
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ "path": "packages/react-query" },
{ "path": "packages/react-query-devtools" },
{ "path": "packages/react-query-persist-client" },
{ "path": "packages/svelte-query" },
{ "path": "packages/solid-query" },
{ "path": "packages/vue-query" },
{ "path": "packages/query-devtools" }
Expand Down