Skip to content

Commit dfb26db

Browse files
feat: Collect gzip info in bundler plugins (#145)
Update Rollup, Vite, and Webpack plugins to collect gzip data for compressible assets.
1 parent 7597576 commit dfb26db

File tree

34 files changed

+824
-304
lines changed

34 files changed

+824
-304
lines changed

.changeset/old-cameras-search.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@codecov/bundler-plugin-core": patch
3+
"@codecov/webpack-plugin": patch
4+
"@codecov/rollup-plugin": patch
5+
"@codecov/vite-plugin": patch
6+
"@codecov/nuxt-plugin": patch
7+
"@codecov/remix-vite-plugin": patch
8+
"@codecov/sveltekit-plugin": patch
9+
---
10+
11+
Adjust asset type to contain gzipSize, add new function to collect gzip values

.changeset/stupid-points-vanish.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@codecov/bundler-plugin-core": patch
3+
"@codecov/remix-vite-plugin": patch
4+
"@codecov/sveltekit-plugin": patch
5+
"@codecov/webpack-plugin": patch
6+
"@codecov/rollup-plugin": patch
7+
"@codecov/nuxt-plugin": patch
8+
"@codecov/vite-plugin": patch
9+
---
10+
11+
Set version from passed output arg, and collect gzip information in plugins

.changeset/wise-insects-accept.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@codecov/bundler-plugin-core": patch
3+
"@codecov/remix-vite-plugin": patch
4+
"@codecov/sveltekit-plugin": patch
5+
"@codecov/webpack-plugin": patch
6+
"@codecov/rollup-plugin": patch
7+
"@codecov/nuxt-plugin": patch
8+
"@codecov/vite-plugin": patch
9+
---
10+
11+
Update meta-framework plugins to collect version generated in output arg

integration-tests/fixtures/generate-bundle-stats/nuxt/__snapshots__/nuxt-plugin.test.ts.snap

+18-18
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`Generating nuxt stats 3 {"format":"amd","expected":"amd"} matches the s
1717
"name": StringMatching "@codecov/nuxt-plugin",
1818
"version": "0.0.1-beta.10",
1919
},
20-
"version": "1",
20+
"version": "2",
2121
}
2222
`;
2323
@@ -38,7 +38,7 @@ exports[`Generating nuxt stats 3 {"format":"amd","expected":"amd"} matches the s
3838
"name": StringMatching "@codecov/nuxt-plugin",
3939
"version": "0.0.1-beta.10",
4040
},
41-
"version": "1",
41+
"version": "2",
4242
}
4343
`;
4444
@@ -59,7 +59,7 @@ exports[`Generating nuxt stats 3 {"format":"cjs","expected":"cjs"} matches the s
5959
"name": StringMatching "@codecov/nuxt-plugin",
6060
"version": "0.0.1-beta.10",
6161
},
62-
"version": "1",
62+
"version": "2",
6363
}
6464
`;
6565
@@ -80,7 +80,7 @@ exports[`Generating nuxt stats 3 {"format":"cjs","expected":"cjs"} matches the s
8080
"name": StringMatching "@codecov/nuxt-plugin",
8181
"version": "0.0.1-beta.10",
8282
},
83-
"version": "1",
83+
"version": "2",
8484
}
8585
`;
8686
@@ -101,7 +101,7 @@ exports[`Generating nuxt stats 3 {"format":"es","expected":"esm"} matches the sn
101101
"name": StringMatching "@codecov/nuxt-plugin",
102102
"version": "0.0.1-beta.10",
103103
},
104-
"version": "1",
104+
"version": "2",
105105
}
106106
`;
107107
@@ -122,7 +122,7 @@ exports[`Generating nuxt stats 3 {"format":"es","expected":"esm"} matches the sn
122122
"name": StringMatching "@codecov/nuxt-plugin",
123123
"version": "0.0.1-beta.10",
124124
},
125-
"version": "1",
125+
"version": "2",
126126
}
127127
`;
128128
@@ -143,7 +143,7 @@ exports[`Generating nuxt stats 3 {"format":"esm","expected":"esm"} matches the s
143143
"name": StringMatching "@codecov/nuxt-plugin",
144144
"version": "0.0.1-beta.10",
145145
},
146-
"version": "1",
146+
"version": "2",
147147
}
148148
`;
149149
@@ -164,7 +164,7 @@ exports[`Generating nuxt stats 3 {"format":"esm","expected":"esm"} matches the s
164164
"name": StringMatching "@codecov/nuxt-plugin",
165165
"version": "0.0.1-beta.10",
166166
},
167-
"version": "1",
167+
"version": "2",
168168
}
169169
`;
170170
@@ -185,7 +185,7 @@ exports[`Generating nuxt stats 3 {"format":"module","expected":"esm"} matches th
185185
"name": StringMatching "@codecov/nuxt-plugin",
186186
"version": "0.0.1-beta.10",
187187
},
188-
"version": "1",
188+
"version": "2",
189189
}
190190
`;
191191
@@ -206,7 +206,7 @@ exports[`Generating nuxt stats 3 {"format":"module","expected":"esm"} matches th
206206
"name": StringMatching "@codecov/nuxt-plugin",
207207
"version": "0.0.1-beta.10",
208208
},
209-
"version": "1",
209+
"version": "2",
210210
}
211211
`;
212212
@@ -227,7 +227,7 @@ exports[`Generating nuxt stats 3 {"format":"iife","expected":"iife"} matches the
227227
"name": StringMatching "@codecov/nuxt-plugin",
228228
"version": "0.0.1-beta.10",
229229
},
230-
"version": "1",
230+
"version": "2",
231231
}
232232
`;
233233
@@ -248,7 +248,7 @@ exports[`Generating nuxt stats 3 {"format":"iife","expected":"iife"} matches the
248248
"name": StringMatching "@codecov/nuxt-plugin",
249249
"version": "0.0.1-beta.10",
250250
},
251-
"version": "1",
251+
"version": "2",
252252
}
253253
`;
254254
@@ -269,7 +269,7 @@ exports[`Generating nuxt stats 3 {"format":"umd","expected":"umd"} matches the s
269269
"name": StringMatching "@codecov/nuxt-plugin",
270270
"version": "0.0.1-beta.10",
271271
},
272-
"version": "1",
272+
"version": "2",
273273
}
274274
`;
275275
@@ -290,7 +290,7 @@ exports[`Generating nuxt stats 3 {"format":"umd","expected":"umd"} matches the s
290290
"name": StringMatching "@codecov/nuxt-plugin",
291291
"version": "0.0.1-beta.10",
292292
},
293-
"version": "1",
293+
"version": "2",
294294
}
295295
`;
296296
@@ -311,7 +311,7 @@ exports[`Generating nuxt stats 3 {"format":"system","expected":"system"} matches
311311
"name": StringMatching "@codecov/nuxt-plugin",
312312
"version": "0.0.1-beta.10",
313313
},
314-
"version": "1",
314+
"version": "2",
315315
}
316316
`;
317317
@@ -332,7 +332,7 @@ exports[`Generating nuxt stats 3 {"format":"system","expected":"system"} matches
332332
"name": StringMatching "@codecov/nuxt-plugin",
333333
"version": "0.0.1-beta.10",
334334
},
335-
"version": "1",
335+
"version": "2",
336336
}
337337
`;
338338
@@ -353,7 +353,7 @@ exports[`Generating nuxt stats 3 {"format":"systemjs","expected":"system"} match
353353
"name": StringMatching "@codecov/nuxt-plugin",
354354
"version": "0.0.1-beta.10",
355355
},
356-
"version": "1",
356+
"version": "2",
357357
}
358358
`;
359359
@@ -374,6 +374,6 @@ exports[`Generating nuxt stats 3 {"format":"systemjs","expected":"system"} match
374374
"name": StringMatching "@codecov/nuxt-plugin",
375375
"version": "0.0.1-beta.10",
376376
},
377-
"version": "1",
377+
"version": "2",
378378
}
379379
`;

integration-tests/fixtures/generate-bundle-stats/nuxt/nuxt-plugin.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ describe("Generating nuxt stats", () => {
8080
name: expect.any(String),
8181
normalized: expect.any(String),
8282
size: expect.any(Number),
83+
gzipSize: expect.anything(),
8384
},
8485
]),
8586
chunks: expect.arrayContaining([
@@ -123,6 +124,7 @@ describe("Generating nuxt stats", () => {
123124
name: expect.any(String),
124125
normalized: expect.any(String),
125126
size: expect.any(Number),
127+
gzipSize: expect.anything(),
126128
},
127129
]),
128130
chunks: expect.arrayContaining([

0 commit comments

Comments
 (0)