Hi,
This is related to #50 because i found the root cause of the problem.
This plugin does not return valid json by creating a circular reference to the file in it's data.
If i console.log(JSON.stringify(data)); i get:
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at modifyContents (/Users/mrleblanc/GitHub/project-starter/node_modules/gulp-twig/index.js:40:20)
at wrappedMapper (/Users/mrleblanc/GitHub/project-starter/node_modules/map-stream/index.js:84:19)
at Stream.stream.write (/Users/mrleblanc/GitHub/project-starter/node_modules/map-stream/index.js:96:21)
at DestroyableTransform.ondata (/Users/mrleblanc/GitHub/project-starter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:619:20)
at emitOne (events.js:115:13)
at DestroyableTransform.emit (events.js:210:7)
at addChunk (/Users/mrleblanc/GitHub/project-starter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:291:12)
at readableAddChunk (/Users/mrleblanc/GitHub/project-starter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:278:11)
at DestroyableTransform.Readable.push (/Users/mrleblanc/GitHub/project-starter/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:245:10)
This is because of the _file and _target data which are added.
Here's the original data intended to be passed to twig:
Hi, This is related to #50 because i found the root cause of the problem. This plugin does not return valid json by creating a circular reference to the file in it's data. If i
console.log(JSON.stringify(data));
i get:This is because of the _file and _target data which are added. Here's the original data intended to be passed to twig:
Here's the data twig receive after gulp-twig:
If someone could check and approve #51