You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,6 +229,39 @@ That means it won't account for post-processing from other plugins and also won'
229
229
230
230
Rollup allows you to output to multiple files. If you are outputting to multiple files you will get a distinct analysis for each output file. Each analysis will contain data on the files imported by the respective target.
231
231
232
+
One way to manipulate the number of reports in this scenario is through the `onAnalysis` callback option:
233
+
234
+
```js
235
+
// Track iterations over output files
236
+
let analyzePluginIterations =0;
237
+
238
+
exportdefault {
239
+
input:'myIsomorphicModule.js',
240
+
output: [
241
+
{
242
+
name:'myIsomorphicModule',
243
+
format:'cjs',
244
+
entryFileNames:'[name].cjs'
245
+
},
246
+
{
247
+
name:'myIsomorphicModule',
248
+
format:'es',
249
+
entryFileNames:'[name].mjs'
250
+
}
251
+
],
252
+
plugins: [
253
+
analyze({
254
+
onAnalysis: () => {
255
+
if (analyzePluginIterations >0) {
256
+
throw''; // We only want reports on the first output
0 commit comments