Skip to content

[v3] update vite to v6 #3828

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 7 commits into from
May 2, 2025
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
8 changes: 8 additions & 0 deletions .changeset/late-trains-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@graphiql/plugin-code-exporter': minor
'@graphiql/plugin-explorer': minor
'@graphiql/react': minor
'graphiql': minor
---

update `vite` and related dependencies
5 changes: 2 additions & 3 deletions packages/graphiql-plugin-code-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@
},
"devDependencies": {
"@graphiql/react": "^0.29.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.4.1",
"graphql": "^16.9.0",
"postcss-nesting": "^10.1.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.6.3",
"vite": "^5.4.18"
"vite": "^6.3.3"
}
}
3 changes: 0 additions & 3 deletions packages/graphiql-plugin-code-exporter/postcss.config.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/graphiql-plugin-code-exporter/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const IS_UMD = process.env.UMD === 'true';

export default defineConfig({
plugins: [react({ jsxRuntime: 'classic' })],
css: {
transformer: 'lightningcss',
},
build: {
minify: IS_UMD ? 'esbuild' : false,
// avoid clean cjs/es builds
Expand All @@ -15,6 +18,7 @@ export default defineConfig({
fileName: 'index',
name: 'GraphiQLPluginCodeExporter',
formats: IS_UMD ? ['umd'] : ['cjs', 'es'],
cssFileName: 'style',
},
rollupOptions: {
external: [
Expand Down
6 changes: 3 additions & 3 deletions packages/graphiql-plugin-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
},
"devDependencies": {
"@graphiql/react": "^0.29.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.4.1",
"graphql": "^16.9.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.6.3",
"vite": "^5.4.18",
"vite-plugin-svgr": "^4.2.0"
"vite": "^6.3.3",
"vite-plugin-svgr": "^4.3.0"
}
}
4 changes: 4 additions & 0 deletions packages/graphiql-plugin-explorer/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default defineConfig({
},
}),
],
css: {
transformer: 'lightningcss',
},
build: {
minify: IS_UMD ? 'esbuild' : false,
// avoid clean cjs/es builds
Expand All @@ -24,6 +27,7 @@ export default defineConfig({
fileName: 'index',
name: 'GraphiQLPluginExplorer',
formats: IS_UMD ? ['umd'] : ['cjs', 'es'],
cssFileName: 'style',
},
rollupOptions: {
external: [
Expand Down
11 changes: 5 additions & 6 deletions packages/graphiql-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"exports": {
"./package.json": "./package.json",
".": {
"types": "./types/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./types/index.d.ts"
"require": "./dist/index.js"
},
"./font/roboto.css": "./font/roboto.css",
"./font/fira-code.css": "./font/fira-code.css",
Expand Down Expand Up @@ -76,13 +76,12 @@
"@types/markdown-it": "^14.1.2",
"@types/get-value": "^3.0.5",
"@types/set-value": "^4.0.1",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.4.1",
"graphql": "^16.9.0",
"postcss-nesting": "^10.1.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.6.3",
"vite": "^5.4.18",
"vite-plugin-svgr": "^4.2.0"
"vite": "^6.3.3",
"vite-plugin-svgr": "^4.3.0"
}
}
3 changes: 0 additions & 3 deletions packages/graphiql-react/postcss.config.js

This file was deleted.

6 changes: 2 additions & 4 deletions packages/graphiql-react/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { defineConfig, PluginOption } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import postCssNestingPlugin from 'postcss-nesting';
import type { PluginOptions as ReactCompilerConfig } from 'babel-plugin-react-compiler';
import packageJSON from './package.json';

Expand Down Expand Up @@ -58,9 +57,7 @@ export const plugins: PluginOption[] = [
export default defineConfig({
plugins,
css: {
postcss: {
plugins: [postCssNestingPlugin()],
},
transformer: 'lightningcss',
},
build: {
minify: false,
Expand All @@ -69,6 +66,7 @@ export default defineConfig({
entry: 'src/index.ts',
fileName: 'index',
formats: ['cjs', 'es'],
cssFileName: 'style',
},
rollupOptions: {
external: [
Expand Down
14 changes: 6 additions & 8 deletions packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"./style.css": "./dist/style.css",
"./graphiql.css": "./dist/style.css",
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
"import": "./dist/index.mjs"
}
},
"scripts": {
Expand All @@ -59,11 +59,11 @@
"react-dom": "^16.8.0 || ^17 || ^18"
},
"devDependencies": {
"lightningcss": "^1.29.3",
"babel-plugin-react-compiler": "19.1.0-rc.1",
"vite-plugin-dts": "^4.3.0",
"vite": "^5.3.6",
"postcss-lightningcss": "^1.0.1",
"@vitejs/plugin-react": "^4.3.1",
"vite-plugin-dts": "^4.5.3",
"vite": "^6.3.3",
"@vitejs/plugin-react": "^4.4.1",
"@graphiql/toolkit": "^0.11.2",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
Expand All @@ -73,8 +73,6 @@
"graphql": "^16.9.0",
"graphql-http": "^1.22.1",
"graphql-subscriptions": "^2.0.0",
"postcss": "8.4.31",
"postcss-import": "15.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"start-server-and-test": "^1.10.11",
Expand Down
9 changes: 0 additions & 9 deletions packages/graphiql/postcss.config.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/graphiql/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const umdConfig = defineConfig({
'process.env.NODE_ENV': '"production"',
},
plugins,
css: {
transformer: 'lightningcss',
},
build: {
minify: 'terser', // produce less bundle size
sourcemap: true,
Expand All @@ -46,6 +49,7 @@ const umdConfig = defineConfig({
name: 'GraphiQL',
fileName: 'index',
formats: ['umd'],
cssFileName: 'style',
},
rollupOptions: {
external: ['react', 'react-dom'],
Expand Down
Loading
Loading