javascript multi lines string support
Grunt ~0.4.5
$ npm install grunt-multi-line --save-dev
grunt.loadNpmTasks('grunt-multi-line');
grunt.initConfig({
multiline: {
options: {
beginTag: "'''",
endTag: "'''"
},
replaceWithTheSourceFile: {
files: [{
expand: true,
cwd: 'test/temp',
src: '**/*.js',
dest: 'test/temp'
}]
},
replaceToNewFile: {
options: {
beginTag: "'@'/*",
endTag: "*/"
},
files: {
'test/build/otherTag.js': ['test/src/otherTag.js']
}
}
}
});
$ grunt multiline
var tpl = '''
<h1>{{user.name}}</h1>
<p>{{user.text}}</p>
''';
will turn output as:
var tpl = '\
<h1>{{user.name}}</h1>\
<p>{{user.text}}</p>\
';