JS – Can I import same named exports with multiple files?

For example

File A

export const hello = {...something}

File B

// export name is same to File A
export const hello = {...another}

and Index.js

// want to import File A and File B's hello module like below
import { hello } from './File A', 'File B';

// Iterable like array, object or else
const mergedHello = hello;

I want to import all hello from same directory dynamically.

If there are 100 files with export hello, 100 lines of import is something weird…

Is this possible or any proper module?

I cannot find suitable js module..

Leave a Comment