# extension-build-webpack-plugin

> Creating production ready zip file and update version of browser extension

Latest version **1.1.7** (published 2020-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install extension-build-webpack-plugin
pnpm add extension-build-webpack-plugin
yarn add extension-build-webpack-plugin
bun add extension-build-webpack-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.7 |
| Published | 2020-05-06 |
| First published | 2020-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Jasmin Virdi |
| Maintainers | jasmin_virdi |
| Keywords | webpack, webpack 4, browser, plugin, extension |

## Links

- npm: https://www.npmjs.com/package/extension-build-webpack-plugin
- Repository: https://github.com/Jasmin2895/webpack-plugin
- Homepage: https://github.com/Jasmin2895/webpack-plugin#readme
- Issues: https://github.com/Jasmin2895/webpack-plugin/issues
- npm.io page: https://npm.io/package/extension-build-webpack-plugin

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [archiver](https://npm.io/package/archiver.md) ^3.1.1
- [json-bump](https://npm.io/package/json-bump.md) ^0.1.3

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.7 (latest) — 2020-05-06
- 1.1.6 — 2020-04-10
- 1.1.5 — 2020-04-10
- 1.1.4 — 2020-04-08
- 1.1.3 — 2020-04-08
- 1.1.2 — 2020-04-07
- 1.1.1 — 2020-04-07
- 1.1.0 — 2020-04-07
- 1.0.0 — 2020-04-06

## README

# 📦 Webpack plugin for extension build
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

This plugin helps to create a production ready build for chrome extension. This helps in updating the version of manifest.json file and create a zip folder of the source code.


## Installation

```
npm i extension-build-webpack-plugin
```

This extenion uses src directory to create a zip folder. In order to use this plugin make sure all the browser extension files are in src directory including the manifest.json file.

## Usage

In your `webpack.config.js` file add the following code.

```javascript
const BrowserExtensionPlugin = require("extension-build-webpack-plugin");

module.exports = {
  entry: './path/to/my/entry/file.js',
  output: {
    filename: 'my-first-webpack.bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: 'babel-loader'
      }
    ]
  },
  plugins: [
    new BrowserExtensionPlugin({devMode: false, name: "my-first-webpack.zip", directory: "src", updateType: "minor"})
  ]
};
```
## Custom Options

You can add custom options to modify the behaviour of plugin.

1. `devMode`: Enables the plugin to work in local development mode. This plugin by default runs in production mode, to enable this plugin in development mode set this flag to **true**.
2. `directory`: To modify the name of the output zip directory. If not given a definite name it will create a zip file with a name **prod.zip**. The zip file will be created in the root directory.
3. `directory`: Name of the directory which contains the `manifest.json` file. If not defined it will assume **src**.
4. `updateType`: Defines the type of version update which can be `major` or `minor`. This flag is set to `minor` by default.

---
_Source: https://npm.io/package/extension-build-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
