File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
repo-scripts/size-analysis Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,25 @@ import * as tmp from 'tmp';
22
22
import { Bundler , Mode , run as runBundleAnalysis } from './bundle-analysis' ;
23
23
import { Report } from '../../scripts/size_report/report_binary_size' ;
24
24
25
+ /**
26
+ * Runs bundle analysis for all bundle definition files under:
27
+ *
28
+ * `firebase-js-sdk/repo-scripts/size-analysis/bundle-definitions`
29
+ *
30
+ * The method accepts an optional parameter `version`:
31
+ * 1. when presented (for example, `version` = '9.0.0'), this method measures the bundle size by
32
+ * building test bundles with dependencies at that specific version downloaded from npm
33
+ * 2. when omitted (in this case, `version` = null), this method measures the bundle size by
34
+ * building test bundles with dependencies from local artifacts (e.g. produced by `yarn build`)
35
+ *
36
+ * #1 is intended only for manual runs for the purpose of back-filling historical size data. #2 is
37
+ * intended for CI runs that measure size for the current commit.
38
+ *
39
+ * More details on how a test bundle is built can be found in `bundle-analysis.ts`.
40
+ *
41
+ * @param {string } [version] - If present, the SDK version to run measurement against
42
+ * @returns {Promise<Report[]> } A list of bundle size measurements
43
+ */
25
44
export async function generateReportForBundles ( version ?: string ) {
26
45
const definitionDir = `${ __dirname } /bundle-definitions` ;
27
46
const outputDir = tmp . dirSync ( ) . name ;
You can’t perform that action at this time.
0 commit comments