Skip to content

Commit 9b494d3

Browse files
mvaligurskyMartin Valigursky
andauthored
Support for treeflame (Flamegraph) build size visualisation (#7711)
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent 3b03cd7 commit 9b494d3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

build.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* treemap - Enable treemap build visualization (release only).
1313
* treenet - Enable treenet build visualization (release only).
1414
* treesun - Enable treesun build visualization (release only).
15+
* treeflame - Enable treeflame build visualization (release only).
1516
*/
1617

1718
import { execSync } from 'child_process';
@@ -22,7 +23,8 @@ const ENV_START_MATCHES = [
2223
'target',
2324
'treemap',
2425
'treenet',
25-
'treesun'
26+
'treesun',
27+
'treeflame'
2628
];
2729

2830
const env = [];

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"build:treemap": "npm run build target:release treemap",
112112
"build:treenet": "npm run build target:release treenet",
113113
"build:treesun": "npm run build target:release treesun",
114+
"build:treeflame": "npm run build target:release treeflame",
114115
"build:sourcemaps": "npm run build -- -m",
115116
"watch": "npm run build -- -w",
116117
"watch:release": "npm run build target:release -- -w",

utils/rollup-build-target.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ function getOutPlugins(type) {
149149
}));
150150
}
151151

152+
if (process.env.treeflame) {
153+
plugins.push(visualizer({
154+
filename: `treeflame.${type}.html`,
155+
template: 'flamegraph'
156+
}));
157+
}
158+
152159
return plugins;
153160
}
154161

0 commit comments

Comments
 (0)