CJS interop?
See original GitHub issueTo my understanding this will load CJS files and have named property access on them? There is ongoing discussion if this is going to be implemented or not. I am hesitant to encourage named properties working. In all proposed interopoperability scenarios however, there is a default
export that maps directly to module.exports
. Something to bear in mind, and perhaps remove named imports until interop is ironed out.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Modules & CJS interop - Learn TypeScript w/ Mike North
ES Module imports and exports; CommonJS Interop; Importing non-TS things. The JS ecosystem was without an “official” module specification until 2015, ...
Read more >johnloy/esm-commonjs-interop-manual - GitHub
Interop between ECMAScript modules, aka ES modules, aka ESM, aka JavaScript modules, and CommonJS, aka CJS, modules is a complicated and confusing matter ......
Read more >swc-plugin-node-cjs-interop - npm
An SWC plugin to fix the default import interoperability issue in Node.js. Latest version: 0.1.1, last published: 5 months ago.
Read more >node-cjs-interop - npm Package Health Analysis - Snyk
Learn more about node-cjs-interop: package health score, popularity, security, maintenance, versions and more.
Read more >ESM-CJS interop test - GitHub Pages
node import x import import * as x; x.default import * as x; i...
default‑export default‑export‑runtime
default‑export‑esModule
default‑export‑esModule‑esm‑reexport syntax error undefined
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 Free
Top 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
@bmeck How does something like this sound?
I’ve been discussing with @loganfsmyth on slack about implementing a possible
spec: true
version of the transform that could use that improved helper, as well as more spec compliant exports (live binding, immutable module record).I bring this up because, whew boy are we in enough of the weeds due to incompatibilities of existing CJS interop w/ babel and ESM