Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add outLodashPackage feature to allow for lodash-es, fix .cjs and .mjs files. #2

Merged
merged 2 commits into from
Oct 1, 2021

Conversation

mbullington
Copy link
Contributor

Hello! Thanks for your work on esbuild-plugin-lodash it's really nice.

In using it I found a few issues I wanted to contribute back.

  • Make sure .cjs/.mjs files are treated in the same way as .js (this is what ESBuild itself does), and not trying to find a special loader for cjs/mjs.
  • I added an option outLodashPackage so, if wanted, a user could overwrite calls from lodash to use lodash-es.

@josteph
Copy link
Owner

josteph commented Sep 30, 2021

Hey, thanks for the PR!

Adding outLodashPackage seems to be a bit overkill, if the user has lodash-es installed instead of lodash, this library would have no purpose anymore because it only tries to eliminate the side-effects from non-es lodash. Can you clarify more about the use case for this option?

@mbullington
Copy link
Contributor Author

mbullington commented Sep 30, 2021

Hey @josteph !

This is a good assumption to question. The reason I added outLodashPackage was for parity with https://github.com/jaredpalmer/tsdx#using-lodash , according to this doc @types/lodash is more mature than @types/lodash-es. Thus developers may want to use that over lodash-es but still benefit from ESM tree-shaking.

If that's still the case with @types/lodash-es I'm not sure.

@josteph
Copy link
Owner

josteph commented Oct 1, 2021

Thanks for the good explanation, I didn't know such thing happened with @types/lodash-es 😅

@josteph josteph merged commit f604fee into josteph:main Oct 1, 2021
@josteph
Copy link
Owner

josteph commented Oct 1, 2021

Released v1.1.0

github-actions bot pushed a commit to digitalmaas/esbuild-plugin-lodash that referenced this pull request Jun 5, 2024
## 1.0.0 (2024-06-05)

### Features

* add initial plugin ([9ed8499](9ed8499))
* Add outLodashPackage feature to allow for lodash-es, fix .cjs and .mjs files. ([josteph#2](https://github.com/digitalmaas/esbuild-plugin-lodash/issues/2)) ([f604fee](f604fee))
* fork `eslint-plugin-lodash`, add extension support ([7cf24d6](7cf24d6))
* handle double quotes lodash imports ([josteph#4](https://github.com/digitalmaas/esbuild-plugin-lodash/issues/4)) ([ee59f86](ee59f86)), closes [/github.com/mikeduminy/esbuild-plugin-ramda/blob/main/index.js#L18](https://github.com/digitalmaas//github.com/mikeduminy/esbuild-plugin-ramda/blob/main/index.js/issues/L18)

### Bug Fixes

* import lodash/last bug ([#1](#1)) ([e91dff2](e91dff2))
* loader & function type ([e710105](e710105))
* remove namespace option, use esbuild default namespace ([489d8b3](489d8b3))
* rename plugins ([da4f0e4](da4f0e4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants