I'm using webpack + babel. I have three modules looking like this:
// A.js
// some other imports here
console.log('A');
export default 'some-const';
// B.js
import someConst from './A';
console.log('B', someConst);
export default 'something-else';
// main.js
import someConst from './A';
import somethingElse from './B';
console.log('main', someConst);
When main.js
is executed, I see the following:
B undefined
A
main some-const
If I swap the imports in main.js
, B
becoming the first, I get:
A
B some-const
main some-const
How come B.js
gets undefined
instead of a module in the first version? What's wrong?