PaulTondeur / grunt-cache-busting

Cache busting files and updating references
8 stars 13 forks source link

If reference is not the last attribute in an HTML tag, task enters infinite loop #18

Open dario-ramos opened 6 years ago

dario-ramos commented 6 years ago

This was my replacement:

encoding_template: {
        replace: ['public/views/includes/header.html'],
        replacement: 'encoding_template.html',
        file: 'public/views/includes/encoding.html'
      }

This was the reference inside header.html:

<li class="dropdown" data-ng-controller="EncodingController" data-ng-include="'views/includes/encoding_template.html'" data-ng-show="currencyIsBCH"></li>

Like this, when running the encoding_template task, grunt entered an infinite loop and I had to kill it. The workaround I discovered was moving data-ng-include to the end of the attribute list:

<li class="dropdown" data-ng-controller="EncodingController" data-ng-show="currencyIsBCH" data-ng-include="'views/includes/encoding_template.html'"></li>

This way, it works.