Skip to content

Commit 6f2bebc

Browse files
authored
feat: Collect dynamicImports in plugins (#217)
Collect dynamicImports in plugins.
1 parent 20a677a commit 6f2bebc

File tree

31 files changed

+311
-93
lines changed

31 files changed

+311
-93
lines changed

.changeset/tame-glasses-compete.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@codecov/nextjs-webpack-plugin": minor
3+
"@codecov/bundler-plugin-core": minor
4+
"@codecov/remix-vite-plugin": minor
5+
"@codecov/solidstart-plugin": minor
6+
"@codecov/sveltekit-plugin": minor
7+
"@codecov/webpack-plugin": minor
8+
"@codecov/rollup-plugin": minor
9+
"@codecov/nuxt-plugin": minor
10+
"@codecov/vite-plugin": minor
11+
---
12+
13+
Collect dynamic imports for base bundler plugins, which apply to the extended meta-framework plugins.

integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/__snapshots__/bundle-analyzer.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ exports[`Bundle Analyzer Integration Tests should generate a report and match th
1212
"name": StringMatching "@codecov/bundle-analyzer",
1313
"version": Any<String>,
1414
},
15-
"version": "2",
15+
"version": "3",
1616
}
1717
`;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ describe("Generating nextjs stats", () => {
8282
entry: expect.any(Boolean),
8383
files: expect.arrayContaining([expect.any(String)]),
8484
names: expect.arrayContaining([expect.any(String)]),
85+
dynamicImports: expect.any(Array),
8586
},
8687
]),
8788
modules: expect.arrayContaining([
@@ -130,6 +131,7 @@ describe("Generating nextjs stats", () => {
130131
entry: expect.any(Boolean),
131132
files: expect.arrayContaining([expect.any(String)]),
132133
names: expect.arrayContaining([expect.any(String)]),
134+
dynamicImports: expect.any(Array),
133135
},
134136
]),
135137
modules: expect.arrayContaining([

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

Lines changed: 18 additions & 18 deletions
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": "1.5.1",
1919
},
20-
"version": "2",
20+
"version": "3",
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": "1.5.1",
4040
},
41-
"version": "2",
41+
"version": "3",
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": "1.5.1",
6161
},
62-
"version": "2",
62+
"version": "3",
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": "1.5.1",
8282
},
83-
"version": "2",
83+
"version": "3",
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": "1.5.1",
103103
},
104-
"version": "2",
104+
"version": "3",
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": "1.5.1",
124124
},
125-
"version": "2",
125+
"version": "3",
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": "1.5.1",
145145
},
146-
"version": "2",
146+
"version": "3",
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": "1.5.1",
166166
},
167-
"version": "2",
167+
"version": "3",
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": "1.5.1",
187187
},
188-
"version": "2",
188+
"version": "3",
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": "1.5.1",
208208
},
209-
"version": "2",
209+
"version": "3",
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": "1.5.1",
229229
},
230-
"version": "2",
230+
"version": "3",
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": "1.5.1",
250250
},
251-
"version": "2",
251+
"version": "3",
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": "1.5.1",
271271
},
272-
"version": "2",
272+
"version": "3",
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": "1.5.1",
292292
},
293-
"version": "2",
293+
"version": "3",
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": "1.5.1",
313313
},
314-
"version": "2",
314+
"version": "3",
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": "1.5.1",
334334
},
335-
"version": "2",
335+
"version": "3",
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": "1.5.1",
355355
},
356-
"version": "2",
356+
"version": "3",
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": "1.5.1",
376376
},
377-
"version": "2",
377+
"version": "3",
378378
}
379379
`;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ describe("Generating nuxt stats", () => {
9191
entry: expect.any(Boolean),
9292
files: expect.arrayContaining([expect.any(String)]),
9393
names: expect.arrayContaining([expect.any(String)]),
94+
dynamicImports: expect.any(Array),
9495
},
9596
]),
9697
modules: expect.arrayContaining([
@@ -135,6 +136,7 @@ describe("Generating nuxt stats", () => {
135136
entry: expect.any(Boolean),
136137
files: expect.arrayContaining([expect.any(String)]),
137138
names: expect.arrayContaining([expect.any(String)]),
139+
dynamicImports: expect.any(Array),
138140
},
139141
]),
140142
modules: expect.arrayContaining([

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`Generating remix stats 2 {"format":"amd","expected":"amd"} matches the
1717
"name": StringMatching "@codecov/remix-vite-plugin",
1818
"version": "1.5.1",
1919
},
20-
"version": "2",
20+
"version": "3",
2121
}
2222
`;
2323
@@ -38,7 +38,7 @@ exports[`Generating remix stats 2 {"format":"amd","expected":"amd"} matches the
3838
"name": StringMatching "@codecov/remix-vite-plugin",
3939
"version": "1.5.1",
4040
},
41-
"version": "2",
41+
"version": "3",
4242
}
4343
`;
4444
@@ -59,7 +59,7 @@ exports[`Generating remix stats 2 {"format":"cjs","expected":"cjs"} matches the
5959
"name": StringMatching "@codecov/remix-vite-plugin",
6060
"version": "1.5.1",
6161
},
62-
"version": "2",
62+
"version": "3",
6363
}
6464
`;
6565
@@ -80,7 +80,7 @@ exports[`Generating remix stats 2 {"format":"cjs","expected":"cjs"} matches the
8080
"name": StringMatching "@codecov/remix-vite-plugin",
8181
"version": "1.5.1",
8282
},
83-
"version": "2",
83+
"version": "3",
8484
}
8585
`;
8686
@@ -101,7 +101,7 @@ exports[`Generating remix stats 2 {"format":"es","expected":"esm"} matches the s
101101
"name": StringMatching "@codecov/remix-vite-plugin",
102102
"version": "1.5.1",
103103
},
104-
"version": "2",
104+
"version": "3",
105105
}
106106
`;
107107
@@ -122,7 +122,7 @@ exports[`Generating remix stats 2 {"format":"es","expected":"esm"} matches the s
122122
"name": StringMatching "@codecov/remix-vite-plugin",
123123
"version": "1.5.1",
124124
},
125-
"version": "2",
125+
"version": "3",
126126
}
127127
`;
128128
@@ -143,7 +143,7 @@ exports[`Generating remix stats 2 {"format":"esm","expected":"esm"} matches the
143143
"name": StringMatching "@codecov/remix-vite-plugin",
144144
"version": "1.5.1",
145145
},
146-
"version": "2",
146+
"version": "3",
147147
}
148148
`;
149149
@@ -164,7 +164,7 @@ exports[`Generating remix stats 2 {"format":"esm","expected":"esm"} matches the
164164
"name": StringMatching "@codecov/remix-vite-plugin",
165165
"version": "1.5.1",
166166
},
167-
"version": "2",
167+
"version": "3",
168168
}
169169
`;
170170
@@ -185,7 +185,7 @@ exports[`Generating remix stats 2 {"format":"module","expected":"esm"} matches t
185185
"name": StringMatching "@codecov/remix-vite-plugin",
186186
"version": "1.5.1",
187187
},
188-
"version": "2",
188+
"version": "3",
189189
}
190190
`;
191191
@@ -206,6 +206,6 @@ exports[`Generating remix stats 2 {"format":"module","expected":"esm"} matches t
206206
"name": StringMatching "@codecov/remix-vite-plugin",
207207
"version": "1.5.1",
208208
},
209-
"version": "2",
209+
"version": "3",
210210
}
211211
`;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ describe("Generating remix stats", () => {
8888
entry: expect.any(Boolean),
8989
files: expect.arrayContaining([expect.any(String)]),
9090
names: expect.arrayContaining([expect.any(String)]),
91+
dynamicImports: expect.any(Array),
9192
},
9293
]),
9394
modules: expect.arrayContaining([
@@ -130,6 +131,7 @@ describe("Generating remix stats", () => {
130131
entry: expect.any(Boolean),
131132
files: expect.arrayContaining([expect.any(String)]),
132133
names: expect.arrayContaining([expect.any(String)]),
134+
dynamicImports: expect.any(Array),
133135
},
134136
]),
135137
modules: expect.arrayContaining([

0 commit comments

Comments
 (0)