docs
docs copied to clipboard
Adjust docs for typegen for API 10.1.3+
Lots of comments here - https://github.com/polkadot-js/api/issues/5540
There are basically 3 options -
node --loader ts-node/esm node_modules/.bin/polkadot-types-from-defs --package ...ts-node --esm --skip-project node_modules/.bin/polkadot-types-from-defs --package ...(Some caveats with resolutions)
For both the above you would need "type": "module" added to your package.json
There is also a (distant) 3rd option, using the @polkadot/dev-ts loader - would probably focus on the options above, since this one "works for polkadot-js", but not sure if it doesn't work in specific repos we want to deal with support (especially those with no PRs to close holes). Having said that, it has been tested as a drop-in replacement for some 3rd part typegen repos and works there. This one doesn't need a type: module changes in the package, it always "just does ESM".