gulp-html-replace icon indicating copy to clipboard operation
gulp-html-replace copied to clipboard

Support useref like blocks

Open gunzip opened this issue 9 years ago • 2 comments

To support parsing useref blocks ie.

<!-- build:css combined/style.css -->

regex could become:

var regex = /(\n?)([ \t]*)(<!--\s*build:(\w+(?:-\w+)*)\s+[^-]*\s*-->)\n?([\s\S]*?)\n?(<!--\s*endbuild\s*-->)\n?/ig;

I need html replacement to work aside useref.

gunzip avatar Nov 19 '15 08:11 gunzip

@gunzip I'm not sure about this one. The whole point of this plugin is not to work like useref and instead provide what i think is a better way of achieving this task. Plus what's the point in recreating some other library? If you need this particular syntax then why don't just use useref? Or if the syntax doesn't matter then why don't change it so gulp-html-replace can work with it? What's your use case?

VFK avatar Nov 21 '15 09:11 VFK

My use case consist in

  • collecting assets list through useref
  • use gulp-rev generate a manifest
  • use gulp-html-replace to do some custom replacement using the generated manifest

if i could collect assets through gulp-html-replace this is not needed indeed. If you think i't's an edge case feel free to close the issue anyway =)

gunzip avatar Nov 21 '15 12:11 gunzip