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.

Generate an ESM bundle

See original GitHub issue

Hello! Would you be open to a pull request adding an ESM bundle? This would require roughly two changes:

  1. add a build script build:esm, building the project using a slightly modified tsconfig.json and outputting to dist/esm (or similar).
  2. add a module field to package.json pointing to dist/esm/index.js.

If you are keen I am happy to PR 😃

Thanks for the library!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
aaronjensencommented, Dec 1, 2020

FWIW, it’s being worked on: https://github.com/rollup/plugins/pull/658

1reaction
colinhackscommented, Dec 12, 2020

@mmeylan I’m having trouble reproducing the runtime issues with the ESM module you’re describing. What’s your build process? If you could throw together a reproduction repo that would be awesome. I’m trying to fix the issues with the Zod ES module over the weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An ESM bundle for any NPM package | by Joel Denning
If the package isn't there, you can create a repository that auto-publishes an ESM and SystemJS version every time the official version ...
Read more >
How to Create a Hybrid NPM Module for ESM and CommonJS.
The TypeScript or Babel transpilers will automatically bundle exports into a module.exports and then generate a ".default" reference for you ...
Read more >
webpack – How To Generate an ES Module bundle
In this post I will detail how you can use webpack to output a library (bundle) file that exposes the ECMAscript module (ESM)...
Read more >
Pure ESM package - Discover gists · GitHub
Bundle your dependencies with Webpack into a CommonJS bundle. Use the esm package. I'm having problems with ESM and Webpack. The problem is...
Read more >
Publish ESM and CJS in a single package - Anthony Fu
unbuild is being used to bundle Nuxt 3 and it's sub packages. To use it, we create build.config.ts file in the root.
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