Skip to content

Commit

Permalink
[vite] set build.minify: false for cjs/esm builds (#3656)
Browse files Browse the repository at this point in the history
* aa

* Update .changeset/tidy-fans-reflect.md
  • Loading branch information
dimaMachina authored Jul 25, 2024
1 parent 82f1ecc commit 93c7e9f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/tidy-fans-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@graphiql/plugin-code-exporter": patch
"@graphiql/plugin-explorer": patch
"@graphiql/react": patch
---

set `build.minify: false` for cjs/esm builds since minified variable names change every build time
1 change: 1 addition & 0 deletions packages/graphiql-plugin-code-exporter/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const IS_UMD = process.env.UMD === 'true';
export default defineConfig({
plugins: [react({ jsxRuntime: 'classic' })],
build: {
minify: IS_UMD ? 'esbuild' : false,
// avoid clean cjs/es builds
emptyOutDir: !IS_UMD,
lib: {
Expand Down
1 change: 1 addition & 0 deletions packages/graphiql-plugin-explorer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default defineConfig({
}),
],
build: {
minify: IS_UMD ? 'esbuild' : false,
// avoid clean cjs/es builds
emptyOutDir: !IS_UMD,
lib: {
Expand Down
6 changes: 1 addition & 5 deletions packages/graphiql-react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ export default defineConfig({
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: {
minify: false,
sourcemap: true,
lib: {
entry: 'src/index.ts',
Expand Down

0 comments on commit 93c7e9f

Please sign in to comment.