ES6 newbie here. Maybe it's an easy question, but haven't found any useful info on this. I have modals.js file and modals folder in actions directory.
How can I tell javascript whether I want to import a file or a folder if they have same name?
My expectation is that:
import {...} from './actions/modals'
Can be treated either as modals.js file or modals/index.js. Is there any widely spread solution that will work on any bundler, that will guarantee what exactly do I require?
I understand that I can try to use '.js' extension like:
import {...} from './actions/modals.js'
But my research shown that not all builders support file extension.
I would really appreciate your help in my ES6 learning