# Browser extensions

Create WXT extensions or bring existing browser extensions into Nx.


Build Chrome and Firefox extensions alongside the applications and libraries they use. New extensions use WXT; existing extensions can retain their own framework and scripts.

## Add to your workspace

Check the [Node.js and Nx requirements](/docs/workflows/requirements#platform-plugins) for this plugin before installing.

Install `@megamono/nx-extension` as a development dependency using your workspace's package manager. Merge this entry into the existing `plugins` list in `nx.json`:

```json
{
  "plugins": [
    "@megamono/nx-extension"
  ]
}
```

Run `npm exec -- nx show projects` to find your project, then `npm exec -- nx show project <project>` to see its tasks. Replace `<project>` with the name from the list.

## Create an extension

```sh
megamono add app extension --dry-run
```

Review the name, browser settings, and requested permissions before applying. See [extension application options](/docs/generators/nx-extension-application) for display names and manifest versions.

## Use an existing extension

WXT configuration provides browser-specific development, build, and packaging tasks. Standard extension manifests are also recognized; without WXT, Megamono uses the build, dev, test, and lint scripts you have declared.

Chrome and Firefox manifest versions can be configured separately. Store submission, credentials, and any Safari wrapper remain separate from creating or building the extension.
