twigjs/twig.js

Render output details about includes/embeds

christian-beckmann opened this issue · 1 comments

Is there a way to get all included/embed files of the rendered template?
Purpose: the parcel transformer can then register a file watcher to reload included files if they are changed.

For example the sass compiler gets a result.stats.includedFiles list, which then can be accessed

https://github.com/parcel-bundler/parcel/blob/v2/packages/transformers/sass/src/SassTransformer.js#L76

No, there currently isn't a way to get this via a public API. There are some complexities to determining what files were/would be loaded due to conditional/dynamic loads, so I doubt a feature like this would be able to be added anytime soon.