Skip to content

Commit

Permalink
fix(engine_twig_php): Twig incremental rebuilds
Browse files Browse the repository at this point in the history
Fixes issue where programmatically created twig includes would throw
a warning at compile time.

Closes issue #1015
  • Loading branch information
ZackHawkinsMC committed Sep 9, 2019
1 parent 1ade945 commit 5d33f24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/engine-twig-php/lib/engine_twig_php.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ const engine_twig_php = {
// %}
findPartials: function(pattern) {
const matches = pattern.template.match(this.findPartialsRE);
return matches;
const filteredMatches =
matches &&
matches.filter(match => {
// Filter out programmatically created includes.
// i.e. {% include '@namespace/icons/assets/' ~ name ~ '.svg' %}
return match.indexOf('~') === -1;
});
return filteredMatches;
},

findPartialsWithStyleModifiers(pattern) {
Expand Down

0 comments on commit 5d33f24

Please sign in to comment.