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

[bug] useResponsive 源码缺乏 default 导出,与 babel-plugin-import 配合时出错 #2554

Closed
CJY0208 opened this issue May 17, 2024 · 0 comments · Fixed by #2555
Closed

Comments

@CJY0208
Copy link
Contributor

CJY0208 commented May 17, 2024

使用 babel-plugin-import 按需导入 ahooks 方法时,由于 useResponsive 源码缺乏 default 导出,以下构建结果出错

import _useResponsive from "ahooks/es/useResponsive"

image

{
  plugins:  [
    'babel-plugin-import',
    {
      libraryName: 'ahooks',
      libraryDirectory: 'es',
      camel2DashComponentName: false,
    },
    'ahooks',
  ]
}
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 a pull request may close this issue.

1 participant