An open API service indexing awesome lists of open source software.

https://github.com/jwr1/unplugin-web-ext

Simplify web extension creation with Webpack, Rollup, Vite, and esbuild.
https://github.com/jwr1/unplugin-web-ext

esbuild plugin rollup unplugin vite web-ext webpack

Last synced: 9 months ago
JSON representation

Simplify web extension creation with Webpack, Rollup, Vite, and esbuild.

Awesome Lists containing this project

README

          

# unplugin-web-ext

[![NPM version](https://img.shields.io/npm/v/unplugin-web-ext?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-web-ext)

Simplify web extension creation with Webpack, Rollup, Vite, and esbuild.

## Install

```bash
npm i unplugin-web-ext
```

Webpack

```js
// webpack.config.js
const { WebExtPlugin } = require('unplugin-web-ext/webpack');

module.exports = {
/* ... */
plugins: [
WebExtPlugin({
/* options */
}),
],
};
```


Rollup

```js
// rollup.config.js
import { WebExtPlugin } from 'unplugin-web-ext/rollup';

export default {
plugins: [
WebExtPlugin({
/* options */
}),
],
};
```


Vite

```js
// vite.config.ts
import { WebExtPlugin } from 'unplugin-web-ext/vite';

export default defineConfig({
plugins: [
WebExtPlugin({
/* options */
}),
],
});
```


esbuild

```js
// esbuild.config.js
import { build } from 'esbuild';
import { WebExtPlugin } from 'unplugin-icons/esbuild';

build({
/* ... */
plugins: [
WebExtPlugin({
/* options */
}),
],
});
```


## Usage

```js
WebExtPlugin({
manifest: ['baseManifest.json', { name: 'my extension' }, 'genManifest.js'],
indent: 2,
pkgJsonProps: ['version', 'name: short_name'],
});
```

See [type definitions](src/types.ts) for more details.