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

Breaks protocol-less urls

Open tomyam1 opened this issue 9 years ago • 2 comments

This line breaks protocol-less URLs (that start with //), i.e. it changes //example.com into /example.com.

tomyam1 avatar Jun 07 '15 09:06 tomyam1

I went to fix this, but after seeing how this plugin work I now think a better recipe is just using gulp-rework.

var gulp = require('gulp');
var rework = require('gulp-rework');
var reworkUrl = require('rework-plugin-url');

gulp.task('default', function () {
    return gulp.src('src/app.css')
        .pipe(rework(reworkUrl(function(url) {
          // modifications on url, e.g. using http://medialize.github.io/URI.js/          
          return url;
        ))
        .pipe(gulp.dest('dist'));
});

I suggest this plugin be deprecated because a combination of gulp-rework, rework-plugin-url and a URL mutation library such as URI.js can give the same results.

tomyam1 avatar Jun 07 '15 10:06 tomyam1

@tepez I think this is good a suggestion and will update the readme to reflect this

trentearl avatar Jun 09 '15 04:06 trentearl