Skip to content

Latest commit

 

History

History
98 lines (75 loc) · 1.46 KB

README.md

File metadata and controls

98 lines (75 loc) · 1.46 KB

unplugin-web-ext

NPM version

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

Install

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

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


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

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


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

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


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

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


Usage

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

See type definitions for more details.