Default import returns an object instead of function
sheremet-va opened this issue · comments
Vladimir commented
Using vanilla Node withour preprocessors, importing givens
returns an object with property default
, but type says it's a function:
https://stackblitz.com/edit/node-j89pac?file=index.js
// run `node index.js` in the terminal
import givens from 'givens'
console.log(givens) // { default: fn } instead of givens
This is because you transpile it to exports.default = fn
instead of module.exports = fn
, I think
Related: vitest-dev/vitest#352