arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.1k stars 61 forks source link

add conditional exports entries #137

Closed cometkim closed 1 year ago

arcanis commented 1 year ago

@cometkim I had to revert this PR: https://github.com/arcanis/clipanion/issues/139

If we want to re-land it I think this time we'll need to add tests to make sure that the ESM build works fine (I took a quick look, and I think the idea would be to add an exports entry for ./platform which would point to either node.ts or browser.ts based on whether the node condition is set; Rollup might also need to be upgraded).

cometkim commented 1 year ago

OK I will try again

cometkim commented 1 year ago

@arcanis Can you push your reverted commit to master?

arcanis commented 1 year ago

Pushed 👍

artechventure commented 1 year ago

It seems that exports map in package.json inside subpath like ./platform is not well respected. What about using subpath imports? I think that will solve this platform problem better.

cometkim commented 1 year ago

@arcanis New PR here #140