Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/dgrijuela/modular-lodash-codemod


https://github.com/dgrijuela/modular-lodash-codemod

Last synced: 11 days ago
JSON representation

Lists

README

        

This script makes all your lodash imports modular.

For example:

```
import { sortBy } from 'lodash'
import { throttle, debounce } from 'lodash'
```

Would be:

```
import sortBy from 'lodash/sortBy'
import throttle from 'lodash/throttle'
import debounce from 'lodash/debounce'
```

Setup & Run

```
npm install -g jscodeshift
git clone https://github.com/dgrijuela/modular-lodash-codemod.git
jscodeshift -t modular-lodash-codemod/modular-lodash.js
```

Check both JS and JSX files using the `--extensions` flag:

```
jscodeshift --extensions=js,jsx -t modular-lodash-codemod/modular-lodash.js
```