moduloze
moduloze copied to clipboard
Bug: some `default` ESM imports need to be un-special-cased
RE: https://github.com/getify/import-remap/issues/1#issuecomment-1345722888
Currently, this CJS:
var { default: traverse, } = require("@babel/traverse");
Transpiles to this ESM:
import traverse from "@babel/traverse";
That seems technically correct. But In Babel's case, it needs to transpile to:
import def123 from "@babel/traverse";
var { default: traverse, } = def123;
That's the default import translation for non-default. But probably need a per-dependency config, of some sort, to override this default conversion.