From 12ca0c3c5ca673cf179078b5ddb57982b0a20ebc Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Thu, 14 Dec 2023 13:33:02 +0100 Subject: [PATCH] fix: fix vike-react-query ESM build (fix #49) --- .../renderer/VikeReactQueryWrapper.tsx | 2 +- packages/vike-react-query/src/index.ts | 2 +- .../src/withFallback.test.tsx | 2 +- packages/vike-react-query/tsconfig.json | 28 +++++++++++-------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx b/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx index dbfc22b2..cb5e5a70 100644 --- a/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx +++ b/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx @@ -1,7 +1,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import React, { ReactNode, useState } from 'react' import type { PageContext } from 'vike/types' -import { StreamedHydration } from './StreamedHydration' +import { StreamedHydration } from './StreamedHydration.js' type VikeReactQueryWrapperProps = { pageContext: PageContext diff --git a/packages/vike-react-query/src/index.ts b/packages/vike-react-query/src/index.ts index 9b367894..5ce99bc8 100644 --- a/packages/vike-react-query/src/index.ts +++ b/packages/vike-react-query/src/index.ts @@ -1 +1 @@ -export { withFallback } from './withFallback' +export { withFallback } from './withFallback.js' diff --git a/packages/vike-react-query/src/withFallback.test.tsx b/packages/vike-react-query/src/withFallback.test.tsx index 17a63906..6677896c 100644 --- a/packages/vike-react-query/src/withFallback.test.tsx +++ b/packages/vike-react-query/src/withFallback.test.tsx @@ -1,7 +1,7 @@ import { cleanup, render, waitFor } from '@testing-library/react' import React, { ReactNode, useEffect } from 'react' import { afterEach, describe, expect, it, vi } from 'vitest' -import { withFallback } from './withFallback' +import { withFallback } from './withFallback.js' import { QueryClient, QueryClientProvider, useSuspenseQuery } from '@tanstack/react-query' const Component = withFallback( diff --git a/packages/vike-react-query/tsconfig.json b/packages/vike-react-query/tsconfig.json index d325acef..714277ff 100644 --- a/packages/vike-react-query/tsconfig.json +++ b/packages/vike-react-query/tsconfig.json @@ -1,18 +1,24 @@ { "compilerOptions": { - "jsx": "react", - "module": "ES2020", - "moduleResolution": "Node", - "target": "ES2019", - "lib": ["DOM", "DOM.Iterable", "ESNext"], + "outDir": "./dist/", + // Resolution + "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + // Libs + "lib": ["ES2021", "DOM", "DOM.Iterable"], "types": ["vite/client"], - "esModuleInterop": true, - "skipLibCheck": true, - "allowSyntheticDefaultImports": true, - "noUncheckedIndexedAccess": true, + // Strictness "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitAny": true, + // Output "declaration": true, - "outDir": "./dist/", - "rootDir": "." + "noEmitOnError": false, + "rootDir": "./", + // Misc + "esModuleInterop": true, + "skipLibCheck": true, + "jsx": "react" } }