I have a folder src/config in which I have multiple files a.js, b.js, c.js and index.js
When inside b.js I do
const data = require('./index');
OR
const data = require('./index.js');
I always get an empty object which is really strange
// index.js
module.exports = {
a: require('./a'),
b: require('./b'),
c: require('./c')
}
And I am using this index.js and it works just fine.
So, what I have understood from this is that requiring ./index always returns empty object
Can anyone explain this?