gpt4 book ai didi

javascript - rollup.js 单次导入多次使用

转载 作者:数据小太阳 更新时间:2023-10-29 05:34:29 26 4
gpt4 key购买 nike

您好汇总专家

我有一个 React 组件和一个使用相同导入的商店

//文件:ProfileStore.js

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

--

//文件:Component.js

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

我的输出结果很奇怪:

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

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

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

我如何告诉 rollup.js 使用没有后缀 $1ProfilesActions 的单个实例

非常感谢

最佳答案

我了解到我必须在所有使用 ProfilesActions 的地方调用导入。

所以这意味着还要在 Component.js

中导入

感谢@Clavin 和@Akansh Gulati 的帮助。

关于javascript - rollup.js 单次导入多次使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57450479/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com