Are the three export options exactly equivalent?
// foo.ts
export const foo = () => {}
// foo.ts
const foo = () => {}
export default { foo }
// foo.ts
const foo = () => {}
export { foo }
Disclaimer: I know that import { foo } from './foo' will work just the same in all scenarios but are there any nuances?
Particularly interested in any nuances that might occur when having a mixed ts and js codebase.
Using tsconfig "module": "CommonJS", nodejs v14 and typescript 4.2.4