As we discussed. We need some sort of logic to 'strip' the template Id
`/*
grunt.registerMultiTask('kot2html', 'Grunt task to combine Knockout templates into one HTML for the Knockout.js-External-Template-Engine.', function () {
var path = require('path'),
files = grunt.file.expand(this.data.src),
destObj = path.parse(this.data.dest),
result = '',
deepEqual = require('deep-equal'),
prefix = this.data.prefix,
idRoot = this.data.idRoot,
relativePath;
files.forEach(function (file) {
grunt.verbose.writeln('Processing', file);
// Prevent reading the output file
if (!deepEqual(destObj, path.parse(file))) {
relativePath = path.dirname(file);
//check if a path is defined to used for stripping the base
if(idRoot){
if(path.dirname(file).indexOf(idRoot) === 0){
relativePath = relativePath.replace(idRoot, '');
}else if(path.dirname(file).indexOf(idRoot) > 0){
throw new Error('idRoot is not the root of the source-file');
}else if(path.dirname(file).indexOf(idRoot) === -1){
throw new Error('idRoot does exist in root path of source-file');
}
}
// Strip the extension to determine the template name
var templateId = prefix +
relativePath + '/' +
path.basename(file).replace('.html', '');
var content = grunt.file.read(file);
result += '<script type="text/html" id="' + templateId + '">\n ' + content + '\n</script>\n\n';
}
});
grunt.file.write(this.data.dest, result);
grunt.log.writeln('Compilation to ' + this.data.dest + ' completed successfully');
});