4.0.1 • Published 3 months ago

@metamask/snaps-rollup-plugin v4.0.1

Weekly downloads
-
License
-
Repository
github
Last release
3 months ago

@metamask/snaps-rollup-plugin

A plugin for developing MetaMask Snaps using Rollup. This can be used as alternative to the mm-snap CLI build command. It transforms the bundle to fix common issues with SES. For a list of changes the plugin makes, you can refer to the source code.

Installation

Use Node.js 16.0.0 or later. We recommend using nvm for managing Node.js versions.

Install a dependency in your snap project using yarn or npm:

  • npm install @metamask/snaps-rollup-plugin
  • yarn add @metamask/snaps-rollup-plugin

Usage

Add the plugin to the plugins array in your Rollup configuration:

// rollup.config.js

import snaps from '@metamask/snaps-rollup-plugin';

export default {
  plugins: [snaps(options)],
};

Options

All options are optional, and default to true.

import { Options } from '@metamask/snaps-rollup-plugin';

const options: Options = {
  /**
   * Whether to strip all comments from the bundle.
   */
  stripComments: true,

  /**
   * Whether to evaluate the bundle with SES, to ensure SES compatibility.
   */
  eval: true,

  /**
   * The path to the Snap manifest file. If set, it will be checked and automatically updated with
   * the bundle's hash, if `writeManifest` is enabled. Defaults to `snap/manifest.json` in the
   * current working directory.
   */
  manifestPath: './snap.manifest.json',

  /**
   * Whether to write the updated Snap manifest file to disk. If `manifestPath` is not set, this
   * option has no effect. If this is disabled, an error will be thrown if the manifest file is
   * invalid.
   */
  writeManifest: true,
};
4.0.1

3 months ago

4.0.0

3 months ago

3.0.2

3 months ago

1.0.2

9 months ago

1.0.1

9 months ago

0.36.0-flask.1

10 months ago

1.0.0

9 months ago

0.36.1-flask.1

10 months ago

0.37.3-flask.1

9 months ago

2.0.0

8 months ago

3.0.1

7 months ago

0.37.0-flask.1

10 months ago

0.37.1-flask.1

10 months ago

3.0.0

7 months ago

0.37.2-flask.1

10 months ago

1.0.0-prerelease.1

11 months ago

0.34.1-flask.1

12 months ago

0.34.0-flask.1

12 months ago

0.35.1-flask.1

11 months ago

0.35.2-flask.1

11 months ago

0.33.0-flask.1

1 year ago

0.35.0-flask.1

11 months ago

0.33.1-flask.1

1 year ago

0.32.0

1 year ago

0.31.0

1 year ago

0.32.2

1 year ago

0.32.1

1 year ago

0.30.0

1 year ago

0.29.0

1 year ago

0.28.0

1 year ago

0.27.1

1 year ago

0.27.0

1 year ago

0.26.2

1 year ago

0.26.1

1 year ago

0.26.0

1 year ago

0.25.0

1 year ago

0.24.1

1 year ago

0.24.0

2 years ago