dmonad / lib0

Monorepo of isomorphic utility functions
MIT License
347 stars 62 forks source link

fix cjs path in package.json #22

Closed philippkuehn closed 3 years ago

dmonad commented 3 years ago

Hey @philippkuehn ,

This is already correctly defined. lib0 is an esm module (see type: 'module') that requires you to set the esm module as the target.

Is there an issue you are facing?

Current versions of nodejs allow to set "conditional exports". If you want we can define them instead to allow cjs modules to use lib0 without pointing directly to the dist folder.

philippkuehn commented 3 years ago

Hey @dmonad, actually I currently have a problem using lib0 as a dependency once I want to support esm and cjs. But you are right. The current PR isn't correct. Didn't realize that the module field in package.json is only used by bundlers and not by node.js itself. So I’m closing this because of #23.