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.

[Proposal] use `esm` instead of `babel`

See original GitHub issue

Tests currently use babel in order to enable standard syntax (i.e. import) in modules.

I propose using jest -r esm

It may be that jest does not yet support esm, in which case see https://github.com/exercism/ecmascript/issues/450

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tejasbubanecommented, Sep 10, 2018

I don’t want to sound rude while closing this issue but I hope you understand. Our users will be using different versions of nodejs on their machines while solving exercises and we want to make sure nothing breaks - hence we have to use a transpiler like babel. Thanks ✌️

0reactions
tejasbubanecommented, Aug 26, 2018

esm Just makes es modules work in node. It’s literally that simple. node -r esm or put some esm directives in your package.json and importing es modules just works .

That means esm is not a drop-in replacement for babel right? Babel transpiles user-written modern javascript for the node version installed on user’s machine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Proposal] use esm instead of babel #451 - GitHub
We don't use babel just for import , it allows users to code in modern JS features irrespective of the node version they...
Read more >
In Rollup, create ESM module with no babel transpiling except ...
I can't seem to stop Babel transpiling down to ES5 though - it creates an _objectSpread2() function and replaces every spread operator with...
Read more >
Transpile to ES modules with Babel - Krasimir Tsonev
It turned out the problem is that Navigo is not exported properly as ES module (also known as ESM). The key bit is...
Read more >
You Should be Using esm - DEV Community ‍ ‍
esm lets you seamlessly combine cjs and js modules with little fuss, if you're transpiling just to use import, chances are you shouldn't....
Read more >
Helping Babel move to ES Modules - BigBinary Blog
The Babel project recently moved to running builds on Node.js 14, which means that Babel can now use ES Modules (ESM) instead of...
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