gulp-uglify引起构造函数。名称不当行为
在我的gulpfile.js中,如果我评论这一行
.pipe(uglify({ preserveComments: 'some'}))
,那么我的代码看起来并不丑陋,并且为了遵循代码行,一切正常。
if(Mystudy.constructor.name != "MyStudyView")
但是,如果我使用Gulp-uglify对我的代码进行了统计(不在最上面评论该uglify代码) 然后上面的行看起来像这样
if ("MyStudyView" != e.constructor.name)
,e.constructor.name的价值也变得像“ E”一样丑陋,而不是“ MystudyView”。
我想以与不uglify的工作相同的方式运行代码,并且我也不想在uglify上妥协,我有什么办法可以实现自己想要的东西吗?
额外信息: 该“如果”条件代码写在mystudy.js
的文件名中,以及函数collectit
下方。
In my gulpfile.js if I comment this line
.pipe(uglify({ preserveComments: 'some'}))
then my code is not looking ugly and for following line of code everything is working fine.
if(Mystudy.constructor.name != "MyStudyView")
but if I uglify my code using gulp-uglify(without commenting that uglify code on top)
then the above line looks something like this
if ("MyStudyView" != e.constructor.name)
and value of e.constructor.name is also getting ugly like "e" instead of the "MyStudyView".
I want to run my code the same way as it was working without uglifying and I don't want to compromise on the uglify as well, is there any way that I can achieve what I want?
Extra information:
That "if" condition code is written in the filename of mystudy.js
and under the function closeIt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而不是
写写
Instead of writing
write