jest-worker: should not expose `.default` babel interop
See original GitHub issueimport a from 'jest-worker'
of course, works fine, because it’s using babel on both ends.
However, const b = require('jest-worker')
results in a !== b
, and to get at the proper value, you need to do b.default
.
Entry points should not expose babel interop details like .default
- can https://github.com/facebook/jest/blob/master/packages/jest-worker/src/index.js use module.exports =
instead of export default
(or can you use the add-module-exports
transform?
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (11 by maintainers)
Top Results From Across the Web
babel-runtime missing interop-require-default - Stack Overflow
The plugin babel-preset-es2015 is missing in your package.json, and not installed when you do npm install . Add it, and install again.
Read more >Options - Babel.js
By default babel.transformFromAst will clone the input AST to avoid mutations. Specifying cloneInputAst: false can improve parsing performance if the input ...
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 >babel-preset-jest | Yarn - Package Manager
main. Features. Fixes. Chore & Maintenance. Performance. 29.2.0. Features. [@jest/cli, jest-config] A seed for the test run will be randomly generated, ...
Read more >Babel-loader - Webpack - W3cubDocs
By default this will be added to every file that requires it. You can instead require the babel runtime as a separate module...
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
We’re exporting multiple things (which I don’t wanna change), so the babel plugin won’t work. A named export is probably our only option, although it’s a breaking change. Instead of
export default class JestWorker
we can doexport class JestWorker
. Possibly name itWorker
instead as we don’t need to repeat the package name in the export@SimenB i’m pretty sure you could still change things by attaching all the named exports to the default export, and explicitly add __esModule: true, and it wouldn’t be a breaking change - it’d be pretty gross tho, to be sure.