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

经过FIS压缩后,JS里面的内容中的一个'()'被删掉了,导致JS语法错误 #816

Open
824778305 opened this issue Apr 24, 2018 · 5 comments

Comments

@824778305
Copy link

从网上下载的jspdf.min.js,经过FIS压缩后,JS里面的内容中的一个'( )'符号被删掉了,导致JS语法错误,怎么解决?加什么转义符可以使得FIS不会把这个括号删掉.

@2betop
Copy link
Contributor

2betop commented Apr 24, 2018

来点上下文,贴下代码看看

@824778305
Copy link
Author

2
3
第一幅图是未经过FIS2编译前的。第二幅图是经过FIS编译后的,在IE下查看日志发现错误,报语法错误,从而找到缺了'( )'符号,其它JS没有问题,就只有jspdf.min.js及jspdf.debug.js会出现这种情况

@2betop
Copy link
Contributor

2betop commented Apr 24, 2018

这估计是uglify 的bug。话说既然文件已经是 .min.js 了为何还要再次压缩呢?是不是针对 *.min.js 关闭压缩功能呢?

@824778305
Copy link
Author

我感觉这应该是FIS对JS进行了编译,在编译环节出现了这种错吧,所以我现在解决思路是设置FIS不编译这个JS文件,不知道对不对

@2betop
Copy link
Contributor

2betop commented Apr 24, 2018

我想不到哪会影响这个,我猜猜是 uglify 环节出的问题,所以你试一下只关闭 optimizer 试试。

fis.match('*.min.js', {
  optimizer: null
})

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

2 participants