Closed talentlessguy closed 4 years ago
ESM support so we can do this:
import cac from 'cac' const cli = cac() // ...
No ESM support for Node.js
Adding these fields to package.json
"type": "module", "module: "...", "exports": { ".": { "import": "./dist/index.js", "require": "./dist/index.cjs" }, "./package.json": "./package.json", "./": "./" }
Note that CJS will still work as before, here's an example of such module: https://github.com/talentlessguy/es-mime-types
Because this project already uses Rollup, it will be very easy to add a module target.
if needed, I can make a pull request
Nice, I guess pointing import to ./mod.js would just work then 👌
import
./mod.js
:tada: This issue has been resolved in version 6.6.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Issue Type
Expected
ESM support so we can do this:
Actual
No ESM support for Node.js
Possible Solutions
Adding these fields to package.json
Note that CJS will still work as before, here's an example of such module: https://github.com/talentlessguy/es-mime-types
Because this project already uses Rollup, it will be very easy to add a module target.
Info
if needed, I can make a pull request