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
项目中使用 rc-util/es/warning 后,打包后的生产代码为什么会包含警告代码? #301
Comments
直接 PR 吧 |
@zombieJ 我忘了我们为啥不用 https://github.com/BerkeleyTrue/warning 了 |
能不能用console.warn,有些不兼容写法一时半会改不了,console面板里又有会抛错,太影响开发了。逼得我只能通过alias将warning的路径指向本地的文件,改写里面的代码。 |
同意楼上,我也觉得 |
最早是 antd 里自行实现了 warning,目的是只 warning 用户一次。然后 #47 抽成了通用 util,这样在 rc 里也可以用。 |
问题如题所述
复现案例
https://stackblitz.com/edit/vitejs-vite-zdg5hc?file=src%2FApp.tsx
请看案例中 dist/assets/index.57005310.js 文件中 7356-7467 代码行
期待行为:
正常来说生产代码不应该包含警告(console.log/console.warn/console.error)等不影响项目执行的代码
造成问题的原因:
另外,console !== undefined 可以移除,客户端和服务端不是都有 console 对象么?
The text was updated successfully, but these errors were encountered: