Skip to content

Document Snaps bundle analyzer option #1955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ The latest major MetaMask documentation updates are listed by the month they wer
For a comprehensive list of recent product changes, visit the "Release Notes" section at the bottom
of the [MetaMask developer page](https://metamask.io/developer/).

## April 2025

- Documented [Snaps bundle analyzer option](/snaps/reference/cli/subcommands/#analyze).
([#1955](https://github.com/MetaMask/metamask-docs/pull/1955))

## March 2025

- Added a tutorial for [sending a transaction using Viem](/services/tutorials/ethereum/send-a-transaction/send-a-transaction-viem). ([#1920](https://github.com/MetaMask/metamask-docs/pull/1920))
Expand Down
26 changes: 26 additions & 0 deletions snaps/reference/cli/subcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ Builds a Snap from source.

`b` is an alias for `build`.

#### `analyze`

<Tabs>
<TabItem value="Syntax">

```bash
yarn mm-snap build --analyze <BOOLEAN>
```

</TabItem>
<TabItem value="Example">

```bash
yarn mm-snap build --analyze false
```

</TabItem>
</Tabs>

Enables or disables analyzing the Snap bundle.
This uses [`webpack-bundle-analyzer`](https://github.com/webpack-contrib/webpack-bundle-analyzer) under the hood.

:::info
This option requires [`@metamask/create-snap`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap) version 4.0.4 or later.
:::

#### `c`, `config`

<Tabs>
Expand Down
Loading