TehShrike / deepmerge

A library for deep (recursive) merging of Javascript objects
MIT License
2.75k stars 216 forks source link

is-mergeable-object is a dependency #159

Closed domoritz closed 5 years ago

domoritz commented 5 years ago

https://github.com/TehShrike/deepmerge/blob/ad8cfddaa8f4b79f5e2c6943445a8b42377ec495/package.json#L30 should be a dependency, not a dev dependency, right? I guess in that case the default module file should just be the index.js file instead of the compiled file. This change would enable tree shakers to optimize your code and produce smaller bundles. Or was this removed because of https://github.com/webpack/webpack/issues/6584?

TehShrike commented 5 years ago

The only entry point defined in the package.json is the bundled CommonJS file: https://github.com/TehShrike/deepmerge/blob/master/package.json#L18

The build step bundles the output into a single file, so is-mergeable-object is only needed during the build step.

If somebody manually imported deepmerge/index.js, that could fail, but that's not unsuual for packages that require a build step.

The ESM entry point was removed because of that Webpack issue.

domoritz commented 5 years ago

Thanks for your response. So I suppose future versions of deepmerge may bring back the esm entry point, right? Would is-mergeable-object become a dependency then so that bundlers can de-duplicate the dependency if it's already there?

I'm going to close this issue since there is no immediate todo.

TehShrike commented 5 years ago

Yeah, the next major version can probably drop the bundling.