Can not export the name-imported with default in transpiled cjs #3029
Closed
Description
The ESM js files to transpile:
// fn.js
export function fn() {}
export default fn
// fn1.js
export function fn1() {}
export default fn1
// index.js
export * from './fn'
export * from './fn1'
// package.json
{
"name": "util-ex",
"main": "./lib/index.js",
"module": "./src/index.js",
"type": "commonjs",
}
Used it in another esm package after transpiled, found no cloneObject
exported. exported only after commenting the export default cloneObject
import { fn } from 'util-ex'
console.log(fn) // is undefined
Metadata
Assignees
Labels
No labels