lodash / babel-plugin-lodash

Modular Lodash builds without the hassle.
Other
1.96k stars 91 forks source link

Explain in README what's options.id for #223

Closed yairEO closed 5 years ago

yairEO commented 5 years ago

I don't understand the README...

First you give the example:

"plugins": ["lodash"]

Then

"plugins": [["lodash", { "id": "lodash-compat", "cwd": "some/path" }]]

Without explaining what is the purpose of this mysterious code and why/when would I need to give id

jdalton commented 5 years ago

Hi @yairEO!

The id can be used to make babel-plugin-lodash work with other lodash-like packages. In the example it is using lodash-compat.

yairEO commented 5 years ago

Hi, thanks for replying so quickly.

I am unable to import lodash template.. https://github.com/rollup/rollup/issues/691

jdalton commented 5 years ago

Try

import { template } from 'lodash-es'