-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Does not work with babel-plugin-import #161
Comments
It looks like babel-plugin-import is a Babel 7 plugin. If you haven't already please try this with This would be easier to investigate if you could provide a small repo demonstrating the issue. |
What makes you think so? Since v1.6.0, the plugin is compatible with Babel 7, but support wasn't dropped as far as I know.
My project uses babel 6, which is why I assume this won't fix the bug?
Ok, I'll try to get some time for that. |
https://github.com/ant-design/babel-plugin-import/blob/master/src/Plugin.js#L2 shows that it uses babel 7 modules. I do not recommend mixing babel 6 and babel 7, so if your project uses babel 6 I recommend trying again with |
Still has this problem when I use babel 7 and istanbul@5.x a small repo demonstrating the issue: https://github.com/yutingzhao1991/istanbul-import-bugreport see https://github.com/yutingzhao1991/istanbul-import-bugreport/blob/master/lib/index.js#L53 , uniq is undefined |
@yutingzhao1991 same bug |
I can confirm this, thank you for the demo repository. Interesting note this works when I do a two-stage tranformation. I created the following babel.config.js: module.exports = {
env: {
step1: {
presets: ['@babel/preset-env'],
plugins: [
['import', {
libraryName: 'lodash',
libraryDirectory: '',
camel2DashComponentName: false,
}, 'lodash']
]
},
step2: {
plugins: [['istanbul', {useInlineSourceMaps: false}]]
}
}
}; Then ran:
This produced what I expected to see in |
I also encountered the same problem. The same code, using Jest for testing。 |
The same bug. And can anyone provide a solution? thx. |
I find a way to solve this problem, maybe it's a not perfect way, but I hope it can bring some inspiration to you. |
A temporary way: |
@Mrjeff578575 have you considered submitting that patch to babel-plugin-import? |
the same bug. |
the same bug |
1 similar comment
the same bug |
how about this bug? |
Hi,
when combining this plugin with babel-plugin-import, the compilation drops import/require statements. For example,
with this .babelrc:
results in this output:
where
Table
andInput
are never defined.The text was updated successfully, but these errors were encountered: