From b8f810ed8e7c50321770a98384e670eb6ecc6c3a Mon Sep 17 00:00:00 2001 From: Thomas Heyenbrock Date: Mon, 22 May 2023 12:50:01 +0200 Subject: [PATCH 1/3] fix duplicated vite config --- packages/graphiql-react/vite.config.d.ts | 2 -- packages/graphiql-react/vite.config.js | 42 ------------------------ packages/graphiql-react/vite.config.ts | 7 ++++ 3 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 packages/graphiql-react/vite.config.d.ts delete mode 100644 packages/graphiql-react/vite.config.js diff --git a/packages/graphiql-react/vite.config.d.ts b/packages/graphiql-react/vite.config.d.ts deleted file mode 100644 index be343359fd8..00000000000 --- a/packages/graphiql-react/vite.config.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: import('vite').UserConfigExport; -export default _default; diff --git a/packages/graphiql-react/vite.config.js b/packages/graphiql-react/vite.config.js deleted file mode 100644 index 6e7737f19f4..00000000000 --- a/packages/graphiql-react/vite.config.js +++ /dev/null @@ -1,42 +0,0 @@ -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react'; -import reactSvgPlugin from 'vite-plugin-react-svg'; -import postCssNestingPlugin from 'postcss-nesting'; -// import noBundlePlugin from 'vite-plugin-no-bundle'; -export default defineConfig({ - plugins: [ - // TODO: disable bundling dependencies - // noBundlePlugin(), - react(), - reactSvgPlugin({ - defaultExport: 'component', - expandProps: 'end', - titleProp: true, - }), - ], - css: { - postcss: { - // @ts-expect-error - plugins: [postCssNestingPlugin()], - }, - }, - esbuild: { - // We use function names for generating readable error messages, so we want - // them to be preserved when building and minifying. - keepNames: true, - }, - build: { - sourcemap: true, - lib: { - entry: 'src/index.ts', - fileName: 'graphiql-react', - formats: ['cjs', 'es'], - }, - rollupOptions: { - external: ['graphql', 'react', 'react-dom'], - output: { - chunkFileNames: '[name].[format].js', - }, - }, - }, -}); diff --git a/packages/graphiql-react/vite.config.ts b/packages/graphiql-react/vite.config.ts index e99ab25c662..6142481dcec 100644 --- a/packages/graphiql-react/vite.config.ts +++ b/packages/graphiql-react/vite.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import reactSvgPlugin from 'vite-plugin-react-svg'; +import postCssNestingPlugin from 'postcss-nesting'; export default defineConfig({ plugins: [ @@ -11,12 +12,18 @@ export default defineConfig({ titleProp: true, }), ], + css: { + postcss: { + plugins: [postCssNestingPlugin()], + }, + }, esbuild: { // We use function names for generating readable error messages, so we want // them to be preserved when building and minifying. keepNames: true, }, build: { + sourcemap: true, lib: { entry: 'src/index.ts', fileName: 'graphiql-react', From 9819a12f4dc7c1a9e3b614128645105d344df411 Mon Sep 17 00:00:00 2001 From: Thomas Heyenbrock Date: Mon, 22 May 2023 12:53:13 +0200 Subject: [PATCH 2/3] add changeset --- .changeset/spicy-eagles-wave.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spicy-eagles-wave.md diff --git a/.changeset/spicy-eagles-wave.md b/.changeset/spicy-eagles-wave.md new file mode 100644 index 00000000000..193f1a57800 --- /dev/null +++ b/.changeset/spicy-eagles-wave.md @@ -0,0 +1,5 @@ +--- +'@graphiql/react': patch +--- + +Remove duplicate Vite config and again make sure to not include `react/jsx-runtime` in the bundle From 07136c81bba9ad049b9063144088c07337cbdbd6 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 22 May 2023 15:21:41 +0200 Subject: [PATCH 3/3] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index ff592e79bbc..7372a037449 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ yarn-1.18.0.js examples/*/yarn.lock .eslintcache + +vite.config.d.ts +vite.config.js