Open kopax-polyconseil opened 2 years ago
For version 4 there are no plans to add this (see #194). If version 5 every comes out (see #241) it should have this.
In the meantime you can use https://github.com/RebeccaStevens/deepmerge-ts
We do not use deepmerge
, it is used by one of our dependency, see https://github.com/callstack/react-theme-provider/search?q=deepmerge
As you can see from that link, they only do import deepmerge from 'deepmerge'
, but for some reason, the UMD module gets selected.
Could you at least concider to fix that? So they import the right module? This module is widely use and no doubt a lot of people don't know about this non optimization.
We fixed the import to CJS in our webpack.resolve.alias
// remove when issue is resolved https://github.com/callstack/react-theme-provider/issues/141
'deepmerge': path.join(paths.appNodeModules, 'deepmerge/dist/cjs.js'),
https://www.npmjs.com/package/@bundled-es-modules/deepmerge feel free to use ESM bundled fork of this project.
I felt I had no choice but to do this, since the author seems reluctant to add ESM-first support, and deepmerge-ts is almost 4 times as large as original deepmerge.. Of course, you can also commit yourself to a compile-step like @rollup/plugin-commonjs or webpack/esbuild equivalent but for projects that are otherwise compile-step-free, that's not a great option either.
I will deprecate my fork as soon as the author of this package publishes an ESM version.
Is there a fork in github w/ the actual changes in your npm package @jorenbroekema??
Is there a fork in github w/ the actual changes in your npm package @jorenbroekema??
yes https://github.com/bundled-es-modules/deepmerge , sorry must have forgotten to put this info in the pkg json
all I do is run esbuild (bundler) over the exported deepmerge pkg and format as ESM, then dual publish both ESM / CJS.
Hello and thanks for sharing,
As I can see when working on this matter, you don't have any
module
field in package.json for serving ESM, the most recent version of JS modules.You also don't have a
browser
field for serving the umd.Do you have any plan to add those or is this module obselete?