# browserify-resolutions

> A Browserify plugin that allows more explicit control of module deduping. It purges duplicate modules from the output bundle and prevents modules from loading several times.

Latest version **1.1.0** (published 2016-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install browserify-resolutions
pnpm add browserify-resolutions
yarn add browserify-resolutions
bun add browserify-resolutions
```

## 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.0 |
| Published | 2016-04-21 |
| First published | 2015-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 19 |
| Maintainers | updater |
| Keywords | browserify, browserify-plugin, resolutions, dedupe, duplication |

## Links

- npm: https://www.npmjs.com/package/browserify-resolutions
- Repository: https://github.com/Updater/browserify-resolutions
- Homepage: https://github.com/Updater/browserify-resolutions#readme
- Issues: https://github.com/Updater/browserify-resolutions/issues
- npm.io page: https://npm.io/package/browserify-resolutions

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^3.7.0
- [through2](https://npm.io/package/through2.md) ^0.6.5

## 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.0 (latest) — 2016-04-21
- 1.0.6 — 2015-07-10
- 1.0.5 — 2015-06-17
- 1.0.4 — 2015-06-16
- 1.0.3 — 2015-06-15
- 1.0.2 — 2015-05-07
- 1.0.1 — 2015-04-30
- 1.0.0 — 2015-04-21

## README

#browserify-resolutions [![build status](https://travis-ci.org/Updater/browserify-resolutions.svg?branch=master)](https://travis-ci.org/Updater/browserify-resolutions)
[Bower resolutions](http://jaketrent.com/post/bower-resolutions/) for npm + Browserify... sort of.

A Browserify plugin that allows more explicit control of module deduping. It purges duplicate modules from the output bundle and prevents modules from loading several times.

## Why?
A large dependency tree may include multiple versions of the same module, which may result in it being bundled multiple times, greatly increasing the bundle's size.

#### What about `npm dedupe`?
It can be sufficient, but is sometimes hamstrung as third party modules may be asking for incompatible versions of the same library.

#### What about `peerDependencies`?
Hopefully solves this problem in the future, but currently difficult to work with: https://github.com/npm/npm/issues/6565

#### What about Browserify's own dedupe?
It currently only dedupes identical source files. Even if deduped, a library may be instantiated several times.

E.g., even if Angular is deduped and only bundled once, you may still see:
```
WARNING: Tried to load angular more than once.
```

## How to use
Pass either an array of package names to dedupe or "*" to dedupe everything possible.

```javascript
var resolutions = require('browserify-resolutions');
```

```javascript
// Dedupe Angular
browserify(options)
  .plugin(resolutions, ['angular'])
  .bundle();
```

```javascript
// Dedupe everything possible
browserify(options)
  .plugin(resolutions, '*')
  .bundle();
```

via Browserify CLI

```bash
browserify path-to-your-entry-file.js -p [ browserify-resolutions '*' ] -o path-to-your-destination.js
```

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