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 non-transpiled ECMAScript module as separate package

See original GitHub issue

Currently, there is no field in package.json that can point to non-transpiled ESM, while supporting bundlers like webpack and Rollup or transpilers like Babel.

The best way to provide non-transpiled ESM seems to be providing it in the separate package, e.g., katex-es.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ylemkimoncommented, Oct 30, 2018

Rather than publishing a new package, I think we can use import katex from 'katex/dist/katex'. I will make a documentation PR.

1reaction
ylemkimoncommented, Aug 23, 2018

@kevinbarabash But to use it in old environments with less ES6 support, which is more common use case, it needs to be transpiled to ES5. However, by default, babel-loader (webpack) or rollup-plugin-babel (Rollup) doesn’t transpile dependencies(node_modules). It needs user-side configuration and it’d hard to configure if KaTeX is deep level dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 publish a module written in ES6 to NPM?
The pattern I have seen so far is to keep the es6 files in a src directory and build your stuff in npm's...
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 >
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 >
How to build, test and release a node module in ES6
Let's go through step by step how to create, build and publish a package to npm that's written in ES6. Prerequisites. Ensure you've...
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