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

babel-plugin-danger-remove-unused-import有bug #1015

Closed
OpenGG opened this issue Nov 6, 2018 · 7 comments
Closed

babel-plugin-danger-remove-unused-import有bug #1015

OpenGG opened this issue Nov 6, 2018 · 7 comments

Comments

@OpenGG
Copy link
Contributor

OpenGG commented Nov 6, 2018

问题描述

有用的import 被错误地删除了。

复现步骤
[复现问题的步骤]

  1. 构建项目 https://github.com/OpenGG/taro-remove-unused-import-bug-report
  2. 打开 dist/js/app.js, 可看到其中有未定义变量 GOOGLE/BAIDU, 因为源码中用到了 Computed Property

期望行为

期望构建能正确处理Computed Property, 或给一个选项能禁用 babel-plugin-danger-remove-unused-import

报错信息

Uncaught ReferenceError: BAIDU is not defined
at Object. (app.js:1)
at webpack_require (app.js:1)
at Object. (app.js:1)
at webpack_require (app.js:1)
at App.render (app.js:1)
at lib.dll.js:1
at errorCatcher (lib.dll.js:1)
at renderComponent (lib.dll.js:1)
at mountComponent (lib.dll.js:1)
at ComponentWrapper.init (lib.dll.js:1)

系统信息

  • 操作系统: macOS 10.13.6
  • Taro 版本 1.1.1
  • Node.js 版本 9.2.0
  • 报错平台 h5

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@OpenGG
Copy link
Contributor Author

OpenGG commented Nov 6, 2018

@OpenGG
Copy link
Contributor Author

OpenGG commented Nov 6, 2018

#1013

@imcuttle
Copy link

imcuttle commented Nov 6, 2018

babel-plugin-danger-remove-unused-import@1.1.1 fixed it

@luckyadam
Copy link
Member

@imcuttle 看来我要把插件换回来了😹,昨天刚 fork 了一个 babel-plugin-danger-remove-unused-import-taro

@imcuttle
Copy link

imcuttle commented Nov 6, 2018

@luckyadam 😢 其实提个 pr 就好了,我还算是个活跃分子

@luckyadam
Copy link
Member

@imcuttle 哈哈哈,了解了解~

@OpenGG
Copy link
Contributor Author

OpenGG commented Nov 7, 2018

@luckyadam 何时可以修复?

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

No branches or pull requests

3 participants