Publish ESM modules
See original GitHub issueI’d love to consume this package as an ESM module, so that I can only import the validator functions that I need.
I see that a Rollup configuration is present, but it doesn’t seem to actually be used – the dist
folder with the CJS and ESM builds is not published. The only thing published is a lib
directory that the Babel CLI produces.
Is there a reason for this? If not, I would be happy to update the build scripts, etc. to publish the dist
directory that Rollup produces instead.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Publish ESM and CJS in a single package - Anthony Fu
A short tutorial of shipping both ESM and CJS dual formats in a single NPM package.
Read more >Publish your npm package as ES Module, and backward ...
How to use the package · Use the package as esm module. update your package.json file (add the following) ... "type": "module", ......
Read more >Publishing NPM Packages as Native ES Modules - Medium
Node.js has had native support for ES modules since version 14, here's why you should (probably) be using it, how to migrate, and...
Read more >Publishing and consuming ECMAScript modules via packages
The ecosystem around delivering ECMAScript modules via packages is slowly maturing. This blog post explains how the various pieces fit ...
Read more >How to Create a Hybrid NPM Module for ESM and CommonJS.
Author your code in ES6, ES-Next or Typescript using import and export. From this base, you can import either ES modules or CommonJS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just haven’t finished the work to do it yet. Happy to take a contribution adding it
maybe!