question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish ESM modules

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
jquensecommented, Sep 14, 2018

I just haven’t finished the work to do it yet. Happy to take a contribution adding it

0reactions
jquensecommented, Oct 29, 2019

maybe!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found