我是否有任何gulp任务来评论代码行?我知道很多删除行的任务,但我想注释掉例如
line1 var a = 'mr';
line2 var b = 'mrs;
line3 var c = 'apple';
line4 var d = 'plum';
line5 var e = 'pear';
line6 var f = 'hat';
line7 var g = 'table';
line8 var h = 'spoon';
line9 var i = 'car';
line10 var j = 'ladder';
有了上述内容,我想注释掉例如line2和line6,结果将是:
line1 var a = 'mr';
//line2 var b = 'mrs;
line3 var c = 'apple';
line4 var d = 'plum';
line5 var e = 'pear';
//line6 var f = 'hat';
line7 var g = 'table';
line8 var h = 'spoon';
line9 var i = 'car';
line10 var j = 'ladder';
答案 0 :(得分:0)
在NPM上...
https://www.npmjs.com/package/gulp-uncomment 看起来“ gulp-uncomment”将有助于删除生产中不必要的注释...
https://www.npmjs.com/package/gulp-strip-code 而“ gulp-strip-code”将允许您删除不需要的代码块。本质上是“评论”它们...