明确案例。如何在多行上分割很长的javascript? [英] Clear Case. How to split very long javascript on multiple lines?
问题描述
我有一个JS压缩文件,长约14k,它只在一行上。这会在Clear Case上产生一些问题,无法检查
I have a JS compressed file which is long about 14k and it is on one single line. This creates some problem on Clear Case, making check in impossible
有没有办法修复clearcase?
Is there a way to fix clearcase?
如果我想在多行上分割JS文件,我应该在插入换行符时注意一些事情。显然我不会分裂一个字符串或一个字符串,之后要记住任何其他不明显的事情吗?
If I whant to split the JS file on multiple lines, should I pay attention to something when inserting line breaks. Obviously I won't split a string or anumber, after that any other non obvious thing to keep in mind?
推荐答案
我不喜欢不了解ClearCase。一个安全的分割位置是在字符串常量之外的;
或}
之后,因为不应该有任何评论在压缩的JS中。
I don't know about ClearCase. A safe place to split is after a ;
or }
outside of a string constant since there shouldn't be any comments in compressed JS.
您也可以手动拆分文件;该文件可能不会经常更改,10个换行符或多或少不会影响性能。
You can also split the file manually; the file probably doesn't change often and 10 line feeds more or less won't hurt the performance.
这篇关于明确案例。如何在多行上分割很长的javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!