Skip to content

Commit 330b7b7

Browse files
committed
Make it compatible with react 19
1 parent 8c0f8d1 commit 330b7b7

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@types/react-dom": "^18.2.22",
8080
"@typescript-eslint/eslint-plugin": "^7.2.0",
8181
"@typescript-eslint/parser": "^7.2.0",
82-
"@vitejs/plugin-react": "^4.2.1",
82+
"@vitejs/plugin-react": "^4.3.0",
8383
"autoprefixer": "^10.4.19",
8484
"eslint": "^8.57.0",
8585
"eslint-config-prettier": "^10.1.5",

vite.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { resolve } from 'path';
66
// https://vitejs.dev/config/
77
export default defineConfig({
88
plugins: [
9-
react(),
9+
react({
10+
// Ensure compatibility with React 19
11+
jsxRuntime: 'automatic',
12+
}),
1013
dts({
1114
insertTypesEntry: true,
1215
}),
@@ -19,11 +22,12 @@ export default defineConfig({
1922
fileName: (format) => `index.${format === 'es' ? 'js' : 'cjs'}`,
2023
},
2124
rollupOptions: {
22-
external: ['react', 'react-dom', '@vapi-ai/web'],
25+
external: ['react', 'react-dom', 'react/jsx-runtime', '@vapi-ai/web'],
2326
output: {
2427
globals: {
2528
react: 'React',
2629
'react-dom': 'ReactDOM',
30+
'react/jsx-runtime': 'React',
2731
'@vapi-ai/web': 'Vapi',
2832
},
2933
},

0 commit comments

Comments
 (0)