We are already running replace-imports.sh from build:libs that is run
before publishing to NPM so callingit when "prepublish" is a redundancy,
besides prepublish.js was only building for cjs and now we are going to
have cjs and esm.
- Adding ESM builds for all the packages that are published on 'npm'.
- Adding libESM to published files in package.json files
- Relays only on "exports" section on package.json to define the ways to consume the package, so only modern bundlers would be able to use them, that should not be an issue, since projects are used to be on the latest
- Using the root tsconfig.libESM
- Using wildcard for @trezor/utils export so we can import any of the functions directly https://nodejs.org/api/packages.html#subpath-patterns