Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple imports #212

Merged
merged 1 commit into from
Mar 8, 2018
Merged

Fix multiple imports #212

merged 1 commit into from
Mar 8, 2018

Conversation

yesmeck
Copy link
Contributor

@yesmeck yesmeck commented Feb 28, 2018

原来在 babel 7 里有问题是因为这里 有判断会跳过相同的节点,clone 一次就可以绕过这个问题。

@yesmeck yesmeck requested a review from sorrycc February 28, 2018 10:06
@yyfearth
Copy link

yyfearth commented Mar 8, 2018

现在如果用esm 会导致多次重复的 import
非常烦人 希望这个 PR 快点 merge

目前

import { Menu as AntMenu } from 'antd'
const { Divider, SubMenu, ItemGroup } = AntMenu

变成

import 'antd/lib/menu/style';
import _Menu4 from 'antd/lib/menu';
import 'antd/lib/menu/style';
import _Menu3 from 'antd/lib/menu';
import 'antd/lib/menu/style';
import _Menu2 from 'antd/lib/menu';
import 'antd/lib/menu/style';
import _Menu from 'antd/lib/menu';

修复后

import 'antd/lib/menu/style';
import _Menu from 'antd/lib/menu';

就正常了

@yesmeck yesmeck merged commit 2bb61d8 into master Mar 8, 2018
@yesmeck yesmeck deleted the fix-mutilple-import branch March 8, 2018 07:10
zhanguangao pushed a commit to zhanguangao/babel-plugin-module-federation-import that referenced this pull request Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants