I was thinking about the best approach on how to handle esm as 3rd party module dependency.
it probably depends on the particular use case of a particular module.
let's say we have a utility module, meant for being used in the browser as well as in node.js, e.g. like lodash, exposing "main" and "module" in package.json. main points to the bridge, module points to the real deal.
I'm leaning towards dev dependency as well as either peer dependency or optional dependency (although I must admit I'm not sure about the ins and outs of optional dependencies
I was thinking about the best approach on how to handle
esm
as 3rd party module dependency.it probably depends on the particular use case of a particular module.
let's say we have a utility module, meant for being used in the
browser
as well as innode.js
, e.g. likelodash
, exposing "main" and "module" in package.json.main
points to the bridge,module
points to the real deal.I'm leaning towards
dev dependency
as well as eitherpeer dependency
oroptional dependency
(although I must admit I'm not sure about the ins and outs ofoptional dependencies
or:
@jdalton any thoughts or suggestions on this one?