Skip to content

Commit 242754f

Browse files
feature: bundle visualizer (#949)
* feat: Add --visualizer flag to generate build output stats Co-authored-by: Alex Hayton <[email protected]> * docs: Adding changeset * chore: Removing & git ignoring stats.html Co-authored-by: Alex Hayton <[email protected]>
1 parent ecb0b02 commit 242754f

File tree

10 files changed

+391
-90
lines changed

10 files changed

+391
-90
lines changed

.changeset/great-dolphins-tan.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': minor
3+
---
4+
5+
Add --visualize flag to generate build output stats

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ yarn.lock
1212
.idea
1313
.rts2*
1414
sizes.csv
15+
test/fixtures/visualizer/stats.html

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ microbundle --workers
278278
For more information see
279279
[@surma/rollup-plugin-off-main-thread](https://github.com/surma/rollup-plugin-off-main-thread#config).
280280
281+
### Visualize Bundle Makeup
282+
283+
Use the `--visualize` flag to generate a `stats.html` file at build time, showing the makeup of your bundle. Uses [rollup-plugin-visualizer](https://www.npmjs.com/package/rollup-plugin-visualizer).
284+
281285
### Mangling Properties
282286
283287
To achieve the smallest possible bundle size, libraries often wish to rename internal object properties or class members to smaller names - transforming `this._internalIdValue` to `this._i`. Microbundle doesn't do this by default, however it can be enabled by creating a `mangle.json` file (or a `"mangle"` property in your package.json). Within that file, you can specify a regular expression pattern to control which properties should be mangled. For example: to mangle all property names beginning an underscore:
@@ -342,6 +346,7 @@ Options
342346
--css Where to output CSS: "inline" or "external" (default "external")
343347
--css-modules Configures .css to be treated as modules (default null)
344348
--workers Bundle module workers - see https://git.io/J3oSF (default false)
349+
--visualize Generate bundle makeup visualization (stats.html)
345350
-h, --help Displays this message
346351

347352
Examples

0 commit comments

Comments
 (0)