gulp-css-url-adjuster icon indicating copy to clipboard operation
gulp-css-url-adjuster copied to clipboard

targeting only image url but not fonts url

Open anurupborah2001 opened this issue 8 years ago • 1 comments

HI, I am using the gulp-css-url-adjuster to change the url of images in scss but i have noticed that it changes fonts url too..Is it possible to target only image URL like background urls??

anurupborah2001 avatar Apr 07 '16 09:04 anurupborah2001

In your case, you can use the gulp-modify-css-urls. https://www.npmjs.com/package/gulp-modify-css-urls You should sort urls with RegExp like this /\w+.(jpg|png|svg)/ For example, .pipe(modifyCssUrls({ modify: function(url, filePath) { if(/^([a-z])([a-z]|[A-Z]|-)+.(jpg|png|svg)/i.test(url)) return '../img/blocks/' + url; else return url; } }))

timur-svoboda avatar May 22 '18 15:05 timur-svoboda