From 450f5a5fd249bd70873a3336ac7a84477de83304 Mon Sep 17 00:00:00 2001 From: Sebastien LeBlanc Date: Tue, 6 Mar 2018 13:19:09 -0500 Subject: [PATCH] [FIX] #50 Remove metadata from twig context [FIX] Remove unused data._file [FIX] Replace data._target with local variable --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0fc852f..6c8534e 100755 --- a/index.js +++ b/index.js @@ -16,6 +16,7 @@ module.exports = function (options) { function modifyContents(file, cb) { var data = file.data || Object.assign({}, options.data); + var target = {}; if (file.isNull()) { return cb(null, file); @@ -25,14 +26,13 @@ module.exports = function (options) { return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported!')); } - data._file = file; if(options.changeExt === false || options.extname === true){ - data._target = { + target = { path: file.path, relative: file.relative } }else{ - data._target = { + target = { path: rext(file.path, options.extname || ''), relative: rext(file.relative, options.extname || '') } @@ -101,7 +101,7 @@ module.exports = function (options) { return cb(new PluginError(PLUGIN_NAME, e)); } - file.path = data._target.path; + file.path = target.path; cb(null, file); }