gulp-css-url-adjuster
gulp-css-url-adjuster copied to clipboard
targeting only image url but not fonts url
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??
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; } }))