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

Added %d as an extended replacement for directory name

Open jtuskan opened this issue 8 years ago • 1 comments

This is my first pull request. Hopefully, everything is in line. This change would allow the use of the file's directory name in replacements. It would be helpful for multi-entry applications.

// Replacement based on the file being processed
// Stream contains ['\root\views\map\index.js', '\root\views\home\index.js']
htmlreplace({
  js: {
    src: null,
    tpl: '<script src="%d.%f.bundle.js"></script>'
  }
})
// Outputs: <script src="map.index.bundle.js"></script>, <script src="home.index.bundle.js"></script>

Please let me know if I can improve my request. Best regards, Joe

jtuskan avatar Sep 07 '16 21:09 jtuskan

Coverage Status

Coverage decreased (-0.6%) to 97.484% when pulling 00b7a9e3551c60f2c593731e2c99a45c05d9a818 on jtuskan:master into 38e66fd157e8d243e70e099b89382b3dc321a99a on VFK:master.

coveralls avatar Sep 07 '16 21:09 coveralls