Skip to content

Commit ee4ba55

Browse files
committed
Add @vitejs/plugin-react for GraphiQL
1 parent ed94f36 commit ee4ba55

File tree

3 files changed

+305
-19
lines changed

3 files changed

+305
-19
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
},
5656
"devDependencies": {
5757
"@cypress/code-coverage": "3.14.1",
58+
"@vitejs/plugin-react": "4.4.1",
5859
"@vitejs/plugin-vue": "5.2.4",
5960
"@vitest/coverage-istanbul": "3.1.3",
6061
"@vue/test-utils": "2.4.6",

vite.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import { defineConfig } from 'vite'
1919
import vue from '@vitejs/plugin-vue'
2020
import vuetify from 'vite-plugin-vuetify'
21+
import react from '@vitejs/plugin-react'
2122
import eslint from 'vite-plugin-eslint'
2223
import IstanbulPlugin from 'vite-plugin-istanbul'
2324
import dns from 'dns'
@@ -33,6 +34,8 @@ export default defineConfig(({ mode }) => {
3334
eslint({
3435
failOnError: mode === 'production'
3536
}),
37+
// GraphiQL is a React app:
38+
react(),
3639
]
3740

3841
if (mode !== 'production' && process.env.COVERAGE) {
@@ -56,6 +59,7 @@ export default defineConfig(({ mode }) => {
5659
'@': path.resolve(__dirname, './src'),
5760
$tests: path.resolve(__dirname, './tests'),
5861
lodash: 'lodash-es',
62+
// GraphiQL is a React app (use Preact as it's smaller):
5963
react: 'preact/compat',
6064
'react-dom': 'preact/compat',
6165
}

0 commit comments

Comments
 (0)