11import resolve from '@rollup/plugin-node-resolve' ;
22import json from '@rollup/plugin-json' ;
33import commonjs from '@rollup/plugin-commonjs' ;
4+ import { codecovRollupPlugin } from "@codecov/rollup-plugin" ;
45
56import { name__ } from './lib/meta.js' ;
67
8+ function bundleName ( str ) {
9+ return str
10+ . replaceAll ( ' ' , '_' )
11+ . replaceAll ( '(' , '[' )
12+ . replaceAll ( ')' , ']' ) ;
13+ }
14+ const codecovConfig = ( name ) => ( {
15+ enableBundleAnalysis : process . env . CODECOV_TOKEN !== undefined ,
16+ bundleName : name__ + (
17+ name . length > 0 ? bundleName ( '_' + name ) : ''
18+ ) ,
19+ uploadToken : process . env . CODECOV_TOKEN ,
20+ telemetry : false
21+ } )
22+
723export default [
824 {
925 input : 'src/index.js' ,
1026 plugins : [
1127 resolve ( ) ,
1228 json ( ) ,
13- commonjs ( )
29+ commonjs ( ) ,
30+ codecovRollupPlugin ( codecovConfig ( '' ) )
1431 ] ,
1532 output : [
1633 {
@@ -40,7 +57,8 @@ export default [
4057 plugins : [
4158 resolve ( { preferBuiltins : true } ) ,
4259 json ( ) ,
43- commonjs ( )
60+ commonjs ( ) ,
61+ codecovRollupPlugin ( codecovConfig ( 'Worker' ) )
4462 ] ,
4563 output : {
4664 file : 'dist/worker.js' ,
@@ -60,7 +78,8 @@ export default [
6078 exportConditions : [ 'node' ]
6179 } ) ,
6280 json ( ) ,
63- commonjs ( )
81+ commonjs ( ) ,
82+ codecovRollupPlugin ( codecovConfig ( 'CLI' ) )
6483 ] ,
6584 output : {
6685 file : 'dist/cli.js' ,
@@ -84,7 +103,8 @@ export default [
84103 exportConditions : [ 'node' ]
85104 } ) ,
86105 json ( ) ,
87- commonjs ( )
106+ commonjs ( ) ,
107+ codecovRollupPlugin ( codecovConfig ( 'Windows Integration (Install)' ) )
88108 ] ,
89109 output : {
90110 file : 'dist/windows/install.js' ,
@@ -108,7 +128,8 @@ export default [
108128 exportConditions : [ 'node' ]
109129 } ) ,
110130 json ( ) ,
111- commonjs ( )
131+ commonjs ( ) ,
132+ codecovRollupPlugin ( codecovConfig ( 'Windows Integration (Uninstall)' ) )
112133 ] ,
113134 output : {
114135 file : 'dist/windows/uninstall.js' ,
0 commit comments