0
下面是一个给出的类,我只想替换特定的行。Grunt:替换行中的特定单词
class abc{
Rest of code...
Titan.include('`MyFunction/myControl`.js');
Rest of code...
}
我想替换Titan.include
与myfunc
并从线中删除 “的.js”:
myfunc('`MyFunction/myControl`');
我使用grunt.loadNpmTasks('grunt-string-replace');
任何帮助表示赞赏。
好的,那么你有什么尝试?是否有任何错误?我们没有看到问题所在。 – jakerella 2014-12-19 15:50:10
@jakerella我试过下面的东西。但它只能替换文件的第一行,其他行也是一样的。 DIST:{ 文件:[{ 扩大:真实, CWD: '资源/', SRC: '**/* JS。', DEST: '资源/' }], 选项:{ 更换:[{ 图案: 'Titan.include', 替换: 'MYFUNC' }] } } – Bhavin2887 2014-12-22 05:57:50