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

Proposal: include ES module output via `.mjs` for `lodash` package #4455

Closed
JounQin opened this issue Sep 4, 2019 · 5 comments
Closed

Proposal: include ES module output via `.mjs` for `lodash` package #4455

JounQin opened this issue Sep 4, 2019 · 5 comments
Labels

Comments

@JounQin
Copy link

@JounQin JounQin commented Sep 4, 2019

It is really bad to let library author or end user to choose between lodash and lodash-es, why not just lodash package but with built-in ESM support.

@jdalton jdalton added the question label Sep 10, 2019
@jdalton

This comment has been minimized.

Copy link
Member

@jdalton jdalton commented Sep 10, 2019

Hi @JounQin!

I want to avoid adding any more weight to the primary lodash package. In lodash v5 it will be 💯 ESM but using the .js extension, relying on either a loader or whatever Node options enable it to be so.

@jdalton jdalton closed this Sep 10, 2019
@JounQin

This comment has been minimized.

Copy link
Author

@JounQin JounQin commented Sep 10, 2019

@jdalton It seems v5 is a breaking change for commonjs packages?

@OliverJAsh

This comment has been minimized.

Copy link

@OliverJAsh OliverJAsh commented Sep 11, 2019

👍 to this. We're having to install both lodash (used on server, by Node) and lodash-es (used on client) whilst manually ensuring the versions are kept in sync. It would be great to have one package which delegates to CommonJS or ES Modules using package.json fields main and module (respectively)—this is how other libraries are currently doing it.

@jdalton

This comment has been minimized.

Copy link
Member

@jdalton jdalton commented Sep 12, 2019

I won't have to ship multiple copies with something like esm. I can just ship ES modules.

@JounQin

This comment has been minimized.

Copy link
Author

@JounQin JounQin commented Sep 12, 2019

@jdalton I love ES Module personally and am using it everywhere as possible, but is that great for lib authors which will enforce them adding a building step before publishing?

Of course, it is a great decision which will push ES Module going ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.