gcanti / io-ts

Runtime type system for IO decoding/encoding
https://gcanti.github.io/io-ts/
MIT License
6.68k stars 331 forks source link

Added exports field to package.json #666

Closed viell-dev closed 1 year ago

viell-dev commented 1 year ago

Needed to use io-ts in a package with moduleResolution: NodeNext in tsconfig.json so I added the exports field.

I'm currently using this fork and it's working fine.

Only package.json has been changed.

viell-dev commented 1 year ago

I noticed there are definition files outputted into the es6 folder as well but from a cursory glance they appear identical to the once in the lib folder so I didn't end up using them.


".": {
  "types": "./lib/index.d.ts",
  "require": "./lib/index.js",
  "import": "./es6/index.js"
},

is just cleaner than:

".": {
  "require": {
    "types": "./lib/index.d.ts",
    "default": "./lib/index.js",
  },
  "import": {
    "types": "./es6/index.d.ts",
    "default": "./es6/index.js"
  }
},