vadxq / vite-plugin-vconsole

vite2/3/4/5 plugins vconsole

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

如何判断页面userAgent来选择是否加载vconsole

hi500 opened this issue · comments

在pc电脑端调试的时候,不希望有vconsole,因为vconsole会拦截console的log信息,不便于定位代码。
但是vite的配置文件中,启动的时候无法拿到浏览器的userAgent,这个问题怎么解决,只能是页面打开的时候再去判断是否初始化vconsole了吗

commented

这个似乎目前暂无法支持,后续参数优化的新版本可以考虑加上这个需求

commented

可自定义规则来判断页面userAgent正式版发布啦,欢迎体验:vite-plugin-vconsole v2.0.0