@@ -45,18 +45,21 @@ function generateReportForCDNScripts(): Report[] {
45
45
const reports = [ ] ;
46
46
const firebaseRoot = path . resolve ( __dirname , '../../packages/firebase' ) ;
47
47
const pkgJson = require ( `${ firebaseRoot } /package.json` ) ;
48
+ const compatPkgJson = require ( `${ firebaseRoot } /compat/package.json` ) ;
48
49
49
50
const special_files = [
50
- 'firebase-performance-standalone.es2017.js' ,
51
- 'firebase-performance-standalone.js' ,
52
- 'firebase-firestore.memory.js' ,
53
- 'firebase.js'
51
+ 'firebase-performance-standalone-compat.es2017.js' ,
52
+ 'firebase-performance-standalone-compat.js' ,
53
+ 'firebase-compat.js'
54
54
] ;
55
55
56
56
const files = [
57
57
...special_files . map ( ( file : string ) => `${ firebaseRoot } /${ file } ` ) ,
58
58
...pkgJson . components . map (
59
- ( component : string ) => `${ firebaseRoot } /firebase-${ component } .js`
59
+ ( component : string ) => `${ firebaseRoot } /firebase-${ component . replace ( '/' , '-' ) } .js`
60
+ ) ,
61
+ ...compatPkgJson . components . map (
62
+ ( component : string ) => `${ firebaseRoot } /firebase-${ component } -compat.js`
60
63
)
61
64
] ;
62
65
@@ -77,7 +80,16 @@ async function generateReportForNPMPackages(): Promise<Report[]> {
77
80
for ( const info of packageInfo ) {
78
81
const packages = await findAllPackages ( info . location ) ;
79
82
for ( const pkg of packages ) {
80
- reports . push ( ...( await collectBinarySize ( pkg ) ) ) ;
83
+ try {
84
+ reports . push ( ...( await collectBinarySize ( pkg ) ) ) ;
85
+ } catch ( e ) {
86
+ // log errors and continue to the next package
87
+ console . log (
88
+ `failed to generate report for ${ pkg } .
89
+ error: ${ e } `
90
+ ) ;
91
+ }
92
+
81
93
}
82
94
}
83
95
return reports ;
@@ -104,11 +116,12 @@ async function collectBinarySize(pkg: string): Promise<Report[]> {
104
116
const fields = [
105
117
'main' ,
106
118
'module' ,
107
- 'esm2017' ,
108
119
'browser' ,
120
+ 'esm5' ,
109
121
'react-native' ,
122
+ 'cordova' ,
110
123
'lite' ,
111
- 'lite-esm2017 '
124
+ 'lite-esm5 '
112
125
] ;
113
126
const json = require ( pkg ) ;
114
127
for ( const field of fields ) {
0 commit comments