Simplify web extension creation with Webpack, Rollup, Vite, and esbuild.
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 */ }), ], });
WebExtPlugin({ manifest: ['baseManifest.json', { name: 'my extension' }, 'genManifest.js'], indent: 2, pkgJsonProps: ['version', 'name: short_name'], });
See type definitions for more details.