Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rollup.js single import multiple usages

hello rollup experts

i have a single react component and a store that are using the same import

//file: ProfileStore.js

import ProfilesActions from './ProfilesActions.js'
....

--

//file: Component.js

import ProfilesStore from '../flux/ProfilesStore'
....
render: function() {
    ....
    ProfilesActions.doSomething();
    ....
}

My output result is very weird :

var ProfilesActions$1 = .....//The ProfileActions implementation 

var ProfilesStore = ....
    ProfilesActions$1.doSomething 

var Component = ....
    ProfilesActions.getMoreProfiles();

how can i tell rollup.js to use the single instance of ProfilesActions without the suffix $1

thank you very much

like image 700
shay te Avatar asked Aug 11 '19 13:08

shay te


1 Answers

i learned that i have to call import on all places that using ProfilesActions.

so this means also importing in the Component.js

thank to @Clavin and @Akansh Gulati for helping.

like image 118
shay te Avatar answered Oct 13 '22 00:10

shay te