Skip to content

Commit 4ca7ee1

Browse files
committed
chore: gzip with rollup plugin and dont bundle config as cjs
1 parent 034de40 commit 4ca7ee1

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
8585
"build:esm": "tsc -b tsconfig.esm.json && node scripts/esm-post-process.mjs",
8686
"build:cjs": "tsc -b tsconfig.cjs.json",
87-
"build:umd": "rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript && gzip umd/graphql-http.min.js -c > umd/graphql-http.min.js.gz",
87+
"build:umd": "rollup --configPlugin typescript --config rollup.config.ts",
8888
"build": "yarn build:esm && yarn build:cjs && yarn build:umd",
8989
"release": "semantic-release"
9090
},
@@ -128,6 +128,7 @@
128128
"node-fetch": "^3.3.0",
129129
"prettier": "^2.8.4",
130130
"rollup": "^3.14.0",
131+
"rollup-plugin-gzip": "^3.1.0",
131132
"semantic-release": "^20.1.0",
132133
"tslib": "^2.5.0",
133134
"typedoc": "^0.23.24",

rollup.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typescript from '@rollup/plugin-typescript';
22
import terser from '@rollup/plugin-terser';
3+
import gzip from 'rollup-plugin-gzip';
34

45
export default {
56
input: './src/client.ts',
@@ -16,5 +17,11 @@ export default {
1617
name: 'graphqlHttp',
1718
plugins: [terser()],
1819
},
20+
{
21+
file: './umd/graphql-http.min.js', // gzip plugin will add the .gz extension
22+
format: 'umd',
23+
name: 'graphqlHttp',
24+
plugins: [terser(), gzip()],
25+
},
1926
],
2027
};

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7326,6 +7326,7 @@ __metadata:
73267326
node-fetch: ^3.3.0
73277327
prettier: ^2.8.4
73287328
rollup: ^3.14.0
7329+
rollup-plugin-gzip: ^3.1.0
73297330
semantic-release: ^20.1.0
73307331
tslib: ^2.5.0
73317332
typedoc: ^0.23.24
@@ -11499,6 +11500,15 @@ __metadata:
1149911500
languageName: node
1150011501
linkType: hard
1150111502

11503+
"rollup-plugin-gzip@npm:^3.1.0":
11504+
version: 3.1.0
11505+
resolution: "rollup-plugin-gzip@npm:3.1.0"
11506+
peerDependencies:
11507+
rollup: ">=2.0.0"
11508+
checksum: b6e9671639f50bd4fda586603d784597abe19925ceda81fd4d3aa44f538b3be45f4d4b29ea1e251c20b2f2c3c16f498e762fac266114751f827b324acfca8b4f
11509+
languageName: node
11510+
linkType: hard
11511+
1150211512
"rollup@npm:^3.14.0":
1150311513
version: 3.14.0
1150411514
resolution: "rollup@npm:3.14.0"

0 commit comments

Comments
 (0)