Skip to content

Commit

Permalink
use terser
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Aug 8, 2024
1 parent 1c281ec commit 95bf55f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/graphiql-plugin-code-exporter/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const IS_UMD = process.env.UMD === 'true';
export default defineConfig({
plugins: [react({ jsxRuntime: 'classic' }), dts()],
build: {
minify: IS_UMD ? 'esbuild' : false,
minify: IS_UMD
? 'terser' // produce better bundle size than esbuild
: false,
// avoid clean cjs/es builds
emptyOutDir: !IS_UMD,
lib: {
Expand Down
4 changes: 3 additions & 1 deletion packages/graphiql-plugin-explorer/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export default defineConfig({
dts(),
],
build: {
minify: IS_UMD ? 'esbuild' : false,
minify: IS_UMD
? 'terser' // produce better bundle size than esbuild
: false,
// avoid clean cjs/es builds
emptyOutDir: !IS_UMD,
lib: {
Expand Down
1 change: 1 addition & 0 deletions packages/graphiql/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const umdConfig = defineConfig({
// To bundle `const { createClient } = require('graphql-ws')` in `createWebsocketsFetcherFromUrl` function
plugins: [commonjs()],
build: {
minify: 'terser', // produce less bundle size
sourcemap: true,
emptyOutDir: false,
lib: {
Expand Down

0 comments on commit 95bf55f

Please sign in to comment.