paritytech / capi

[WIP] A framework for crafting interactions with Substrate chains
https://docs.capi.dev
Apache License 2.0
104 stars 9 forks source link

fix: capi node on TS/JS & CJS/ESM #1115

Closed tjjfvi closed 1 year ago

tjjfvi commented 1 year ago

One big change: to properly support CJS, we need to emit only CJS, as only one instance of Capi should ever be loaded.

Additionally, this has a custom require-hook & esm-loader setup that only invokes ts-node if resolving a nets.ts.

Resolves #1112

tjjfvi commented 1 year ago

@ryanleecode Can you confirm this works in Vite / misc workspace setups?