# unplugin-lodash-to-lodashes

> Replace lodash with lodash-es for Vite and Webpack

Latest version **0.2.0** (published 2022-12-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install unplugin-lodash-to-lodashes
pnpm add unplugin-lodash-to-lodashes
yarn add unplugin-lodash-to-lodashes
bun add unplugin-lodash-to-lodashes
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-12-06 |
| First published | 2022-11-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zephyrrro |
| Maintainers | zephyrrro |
| Keywords | unplugin, lodash, lodash-es, vite, webpack |

## Links

- npm: https://www.npmjs.com/package/unplugin-lodash-to-lodashes
- Repository: https://github.com/Zephyrrro/unplugin-lodash-to-lodashes
- Homepage: https://github.com/Zephyrrro/unplugin-lodash-to-lodashes#readme
- Issues: https://github.com/Zephyrrro/unplugin-lodash-to-lodashes/issues
- npm.io page: https://npm.io/package/unplugin-lodash-to-lodashes

## Dependencies (2)

- [unplugin](https://npm.io/package/unplugin.md) ^1.0.0
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^5.0.2

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2022-12-06
- 0.1.2-beta.1 (beta) — 2022-12-05
- 0.1.2-beta.0 — 2022-12-05
- 0.1.1 — 2022-11-30
- 0.1.0 — 2022-11-30

## README

# unplugin-lodash-to-lodashes

<p align="left">
  <a href="https://npmjs.com/package/unplugin-lodash-to-lodashes">
    <img src="https://img.shields.io/npm/v/unplugin-lodash-to-lodashes" alt="npm package">
  </a>
  <img src="https://img.shields.io/npm/dt/unplugin-lodash-to-lodashes" alt="npm downloads">
  <img src="https://img.shields.io/npm/l/unplugin-lodash-to-lodashes" alt="npm downloads">
  <img src="https://img.shields.io/bundlephobia/minzip/unplugin-lodash-to-lodashes" alt="package size">
</p>

**Replace lodash with lodash-es, support use in vite, webpack**

## Installation

```bash
npm i unplugin-lodash-to-lodashes
```

<details>
<summary>Vite</summary><br>

```ts
// vite.config.ts
import lodashToLodashes from 'unplugin-lodash-to-lodashes/vite';

export default defineConfig({
  plugins: [
    lodashToLodashes({ /* options */ }),
  ],
})
```

<br></details>


<details>
<summary>Webpack</summary><br>

```ts
const lodashToLodashes = require('unplugin-lodash-to-lodashes/webpack');

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    lodashToLodashes({ /* options */ }),
  ],
}
```

<br></details>


## Usage

It will automatically transform:

```javascript
import isNull from 'lodash/isNull'
const isNumber = require('lodash/isNumber');

//    ↓ ↓ ↓ ↓ ↓ ↓

import isNull from 'lodash-es/isNull'
const isNumber = require('lodash-es/isNumber.js').default;
```

## Options

### `lib`

```ts
type Lib = string
```

default: `lodash-es`

```javascript
// lib: '../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es'
import isNull from 'lodash/isNull'
const isNumber = require('lodash/isNumber');


//    ↓ ↓ ↓ ↓ ↓ ↓

import isNull from '../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isNull'
const isNumber = require('../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isNumber.js').default;
```

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