Skip to content

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

License

Notifications You must be signed in to change notification settings

jwr1/unplugin-web-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.