I am using babel / ES6 with webpack. I am importing the same โactionโ file, which exports the bundle functions, in two different places. In one place, it returns a module, another undefined :
actions.js
export function test() { ... } export function test2() { ... }
App.js
import actions from './actions' class App extends React.Component { ... } console.log(actions);
change the reason why App.js worked was that it actually used import * as actions , as I said below, I just incorrectly indicated in the example
NestedComponent.js
import actions from './actions' class NestedComponent extends OtherComponent { ... } console.log(actions);
Is this related to the order in which webpack defines modules / files?
Flion source share