From cf80e7d42652b67b4934e59ef1a63a779437b624 Mon Sep 17 00:00:00 2001 From: Ikor Jefocur Date: Sat, 12 Sep 2020 14:19:52 +0300 Subject: [PATCH] Now "toHtml" method changes source bemjson file instead of creating new html file --- packages/gulp-bem-xjst/lib/gulp-bem-xjst.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/gulp-bem-xjst/lib/gulp-bem-xjst.js b/packages/gulp-bem-xjst/lib/gulp-bem-xjst.js index 0c35a0e..6043519 100644 --- a/packages/gulp-bem-xjst/lib/gulp-bem-xjst.js +++ b/packages/gulp-bem-xjst/lib/gulp-bem-xjst.js @@ -125,13 +125,10 @@ module.exports.toHtml = function(templatesStream) { throw new Error('Incorrect html result.'); } - var name = path.basename(bemjsonFile.path).split('.')[0]; - var newFile = new File({ - path: name + (n-- || '') + '.html', - contents: new Buffer(html) - }); + bemjsonFile.path = bemjsonFile.path.split('.')[0] + (n-- || '') + '.html'; + bemjsonFile.contents = new Buffer(html); - _this.push(newFile); + _this.push(bemjsonFile); }); callback();