Sonarr/frontend/gulp/helpers/html-annotate-loader.js

16 lines
372 B
JavaScript
Raw Normal View History

2018-01-13 02:01:27 +00:00
const path = require('path');
const rootPath = path.resolve(__dirname + '/../../src/');
module.exports = function(source) {
if (this.cacheable) {
this.cacheable();
}
const resourcePath = this.resourcePath.replace(rootPath, '');
const wrappedSource =`
<!-- begin ${resourcePath} -->
${source}
<!-- end ${resourcePath} -->`;
return wrappedSource;
};