Skip to content

Commit

Permalink
chore: gzip with rollup plugin and dont bundle config as cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Feb 12, 2023
1 parent 034de40 commit 4ca7ee1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"build:esm": "tsc -b tsconfig.esm.json && node scripts/esm-post-process.mjs",
"build:cjs": "tsc -b tsconfig.cjs.json",
"build:umd": "rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript && gzip umd/graphql-http.min.js -c > umd/graphql-http.min.js.gz",
"build:umd": "rollup --configPlugin typescript --config rollup.config.ts",
"build": "yarn build:esm && yarn build:cjs && yarn build:umd",
"release": "semantic-release"
},
Expand Down Expand Up @@ -128,6 +128,7 @@
"node-fetch": "^3.3.0",
"prettier": "^2.8.4",
"rollup": "^3.14.0",
"rollup-plugin-gzip": "^3.1.0",
"semantic-release": "^20.1.0",
"tslib": "^2.5.0",
"typedoc": "^0.23.24",
Expand Down
7 changes: 7 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import gzip from 'rollup-plugin-gzip';

export default {
input: './src/client.ts',
Expand All @@ -16,5 +17,11 @@ export default {
name: 'graphqlHttp',
plugins: [terser()],
},
{
file: './umd/graphql-http.min.js', // gzip plugin will add the .gz extension
format: 'umd',
name: 'graphqlHttp',
plugins: [terser(), gzip()],
},
],
};
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7326,6 +7326,7 @@ __metadata:
node-fetch: ^3.3.0
prettier: ^2.8.4
rollup: ^3.14.0
rollup-plugin-gzip: ^3.1.0
semantic-release: ^20.1.0
tslib: ^2.5.0
typedoc: ^0.23.24
Expand Down Expand Up @@ -11499,6 +11500,15 @@ __metadata:
languageName: node
linkType: hard

"rollup-plugin-gzip@npm:^3.1.0":
version: 3.1.0
resolution: "rollup-plugin-gzip@npm:3.1.0"
peerDependencies:
rollup: ">=2.0.0"
checksum: b6e9671639f50bd4fda586603d784597abe19925ceda81fd4d3aa44f538b3be45f4d4b29ea1e251c20b2f2c3c16f498e762fac266114751f827b324acfca8b4f
languageName: node
linkType: hard

"rollup@npm:^3.14.0":
version: 3.14.0
resolution: "rollup@npm:3.14.0"
Expand Down

0 comments on commit 4ca7ee1

Please sign in to comment.